Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10 task immipda #22

Merged
merged 28 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7064b94
murtys method changes
EirikKolas Apr 21, 2024
86aa54d
murtys method
EirikKolas Apr 21, 2024
6794f9b
updated ipda ++
EirikKolas Apr 26, 2024
a2e4fc9
and ellipse
EirikKolas Apr 26, 2024
2467608
streamlined immipda step
EirikKolas Apr 29, 2024
7a031f9
fixed mode association update
EirikKolas Apr 29, 2024
3a07ca9
All tests compile
EirikKolas May 2, 2024
977ac06
all tests pass
EirikKolas May 2, 2024
8bdf3fc
✅ made immipda tests
EirikKolas May 5, 2024
6144feb
all tests compile
EirikKolas May 6, 2024
85fe2a8
Added state class
EirikKolas May 7, 2024
7039dc0
Added concept for gauss and state
EirikKolas May 7, 2024
57e7575
Integrated state system into imm filter
EirikKolas May 8, 2024
9ddf869
💡 cleaned up comments
EirikKolas May 8, 2024
926f54d
✅ Fixed tests by removing tests that fail
EirikKolas May 9, 2024
debcf3e
💡 aesthetics
EirikKolas Jul 4, 2024
372ad88
cleaned up io structs in pdaf and fixed gnuplot tests
EirikKolas Jul 4, 2024
f25b20b
fixed tests. Missing documentation
EirikKolas Jul 4, 2024
e473ce3
💡 readded doxygen comments
EirikKolas Jul 6, 2024
8121975
💡 added comments to imm sensor model
EirikKolas Jul 7, 2024
1eec05b
started making State type independent on a specific enum
EirikKolas Jul 13, 2024
b95a938
Made ipda use ellisoid instead of ellipse
EirikKolas Jul 14, 2024
661b85f
temporary fix of statenames
EirikKolas Jul 14, 2024
fbb2cd2
bugfix
jorgenfj Jul 15, 2024
57810b8
updated run unit tests yml
EirikKolas Oct 28, 2024
38abcb1
updated codecov action
EirikKolas Oct 28, 2024
872a1ca
disabled testing on other things than humble for now
EirikKolas Oct 28, 2024
30d1a04
fix
EirikKolas Oct 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
ros_distribution:
- humble
- iron
# - iron

# Define the Docker image(s) associated with each ROS distribution.
# The include syntax allows additional variables to be defined, like
Expand All @@ -34,14 +34,14 @@ jobs:
ros_version: 2

# Iron Irwini (May 2023 - November 2024)
- docker_image: ubuntu:jammy
ros_distribution: iron
ros_version: 2
# - docker_image: ubuntu:jammy
# ros_distribution: iron
# ros_version: 2

# Rolling Ridley (No End-Of-Life)
- docker_image: ubuntu:jammy
ros_distribution: rolling
ros_version: 2
# - docker_image: ubuntu:jammy
# ros_distribution: rolling
# ros_version: 2

container:
image: ${{ matrix.docker_image }}
Expand Down Expand Up @@ -81,13 +81,13 @@ jobs:
package-name: ${{ env.PACKAGES }}
target-ros2-distro: ${{ matrix.ros_distribution }}

- uses: codecov/codecov-action@v1.2.1
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ros_ws/lcov/total_coverage.info,ros_ws/coveragepy/.coverage
flags: unittests
name: codecov-umbrella
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
with:
name: Colcon-logs
path: ${{ steps.action_ros_ci_step.outputs.ros-workspace-directory-name }}/log
Expand Down
2 changes: 1 addition & 1 deletion vortex-filtering/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(
-Wall -Wextra -Wpedantic
-fopenmp # For parallel processing with Eigen
-fconcepts-diagnostics-depth=2 # For better concepts error messages
-fconcepts-diagnostics-depth=3 # For better concepts error messages
-Warray-bounds # For better array bounds error messages
)
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ auto sensor_model = std::make_shared<SensModT>(0.1);
// Specify min and max values for the states that are not comparable
vortex::models::StateMap min_max_values{
{ST::vel, {-10, 10}},
{ST::turn, {-M_PI, M_PI}}
{ST::turn, {-std::numbers::pi, std::numbers::pi}}
};

// Initial state probabilities
Expand Down
33 changes: 19 additions & 14 deletions vortex-filtering/include/vortex_filtering/filters/ekf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,34 @@ template <size_t n_dim_x, size_t n_dim_z, size_t n_dim_u = n_dim_x, size_t n_dim
* @param dyn_mod Dynamic model
* @param sens_mod Sensor model
* @param dt Time step
* @param x_est_prev Previous state estimate
* @param x_est_prev Gauss_x Previous state estimate
* @param u Vec_x Input. Not used, set to zero.
* @return std::pair<Gauss_x, Gauss_z> Predicted state, predicted measurement
* @throws std::runtime_error if dyn_mod or sens_mod are not of the DynamicModelT or SensorModelT type
*/
static std::pair<typename T::Gauss_x, typename T::Gauss_z> predict(const auto &dyn_mod, const auto &sens_mod, double dt, const T::Gauss_x &x_est_prev,
const T::Vec_u &u = T::Vec_u::Zero())
requires(concepts::DynamicModelLTV<decltype(dyn_mod), N_DIM_x, N_DIM_u, N_DIM_v> && concepts::SensorModelLTV<decltype(sens_mod), N_DIM_x, N_DIM_z, N_DIM_w>)
static auto predict(const auto &dyn_mod, const auto &sens_mod, double dt, const auto &x_est_prev, const T::Vec_u &u = T::Vec_u::Zero())
-> std::pair<std::remove_reference_t<decltype(x_est_prev)>, typename T::Gauss_z>
requires(concepts::DynamicModelLTV<decltype(dyn_mod), N_DIM_x, N_DIM_u, N_DIM_v> &&
concepts::SensorModelLTV<decltype(sens_mod), N_DIM_x, N_DIM_z, N_DIM_w> && concepts::MultiVarGaussLike<decltype(x_est_prev), N_DIM_x>)
{
typename T::Gauss_x x_est_pred = dyn_mod.pred_from_est(dt, x_est_prev, u);
using StateT = std::remove_reference_t<decltype(x_est_prev)>;
StateT x_est_pred = StateT{dyn_mod.pred_from_est(dt, x_est_prev, u)};
typename T::Gauss_z z_est_pred = sens_mod.pred_from_est(x_est_pred);
return {x_est_pred, z_est_pred};
}

/** Perform one EKF update step
* @param sens_mod Sensor model
* @param x_est_pred Predicted state
* @param z_est_pred Predicted measurement
* @param x_est_pred Gauss_x Predicted state
* @param z_est_pred Gauss_z Predicted measurement
* @param z_meas Vec_z Measurement
* @return MultivarGauss Updated state
* @throws std::runtime_error ifsens_mod is not of the SensorModelT type
*/
static T::Gauss_x update(const auto &sens_mod, const T::Gauss_x &x_est_pred, const T::Gauss_z &z_est_pred, const T::Vec_z &z_meas)
requires(concepts::SensorModelLTV<decltype(sens_mod), N_DIM_x, N_DIM_z, N_DIM_w>)
static auto update(const auto &sens_mod, const auto &x_est_pred, const auto &z_est_pred, const T::Vec_z &z_meas)
-> std::remove_reference_t<decltype(x_est_pred)>
requires(concepts::SensorModelLTV<decltype(sens_mod), N_DIM_x, N_DIM_z, N_DIM_w> && concepts::MultiVarGaussLike<decltype(x_est_pred), N_DIM_x> &&
concepts::MultiVarGaussLike<decltype(z_est_pred), N_DIM_z>)
{
typename T::Mat_zx C = sens_mod.C(x_est_pred.mean()); // Measurement matrix
typename T::Mat_ww R = sens_mod.R(x_est_pred.mean()); // Measurement noise covariance
Expand All @@ -89,18 +93,19 @@ template <size_t n_dim_x, size_t n_dim_z, size_t n_dim_u = n_dim_x, size_t n_dim
* @param dyn_mod Dynamic model
* @param sens_mod Sensor model
* @param dt Time step
* @param x_est_prev Previous state estimate
* @param x_est_prev Gauss_x Previous state estimate
* @param z_meas Vec_z Measurement
* @param u Vec_x Input
* @return Updated state, predicted state, predicted measurement
*/
static std::tuple<typename T::Gauss_x, typename T::Gauss_x, typename T::Gauss_z>
step(const auto &dyn_mod, const auto &sens_mod, double dt, const T::Gauss_x &x_est_prev, const T::Vec_z &z_meas, const T::Vec_u &u = T::Vec_u::Zero())
requires(concepts::DynamicModelLTV<decltype(dyn_mod), N_DIM_x, N_DIM_u, N_DIM_v> && concepts::SensorModelLTV<decltype(sens_mod), N_DIM_x, N_DIM_z, N_DIM_w>)
static auto step(const auto &dyn_mod, const auto &sens_mod, double dt, const auto &x_est_prev, const T::Vec_z &z_meas, const T::Vec_u &u = T::Vec_u::Zero())
-> std::tuple<std::remove_reference_t<decltype(x_est_prev)>, std::remove_reference_t<decltype(x_est_prev)>, typename T::Gauss_z>
requires(concepts::DynamicModelLTV<decltype(dyn_mod), N_DIM_x, N_DIM_u, N_DIM_v> &&
concepts::SensorModelLTV<decltype(sens_mod), N_DIM_x, N_DIM_z, N_DIM_w> && concepts::MultiVarGaussLike<decltype(x_est_prev), N_DIM_x>)
{
auto [x_est_pred, z_est_pred] = predict(dyn_mod, sens_mod, dt, x_est_prev, u);

typename T::Gauss_x x_est_upd = update(sens_mod, x_est_pred, z_est_pred, z_meas);
auto x_est_upd = update(sens_mod, x_est_pred, z_est_pred, z_meas);
return {x_est_upd, x_est_pred, z_est_pred};
}
};
Expand Down
Loading
Loading