Skip to content

Commit

Permalink
Feature/better imm filter (#8)
Browse files Browse the repository at this point in the history
* started on new IMM filter

* more changes...

* progress

* made changes outlined in @chrstrom's PR review

* Committing clang-format changes

* started on new IMM filter

* more changes...

* progress

* changed state name system. Almost compiles

* Added ostream operator for MultivarGauss.

* added support for specifying min and max state values

* rebased from main

* fixed size error in imm mixing

* Committing clang-format changes

* todo: pass state_names_ to mixing in imm filter

* imm filter done!

* mixing doesn't work as expectd

* fixed imm mixing probs calculation

* updated documentation

* updated documentation

* Update documentation

* updated readmes

* fixed readme

* changed DynMod to DynModPtr across the package

* fixed model getters in imm model

* fixed const get_model of imm

* change gnuplot enable to check value of define

* created classes for types based on macros

* refactored ekf

* started changing all the types

* Changed all except imm test

* Finished converting all types. All tests pass

* made a concept to check for matrix sizes

* Removed all signs of the old DynModI and SensModI stuff

* refactored ekf and ukf to not be dependent on having sizes defined

* refactored imm model and filter to utilize ekf and ukf changes

* try to make gh action use gcc 13

* fixed include and readme

---------

Co-authored-by: Clang Robot <[email protected]>
  • Loading branch information
EirikKolas and Clang Robot authored Mar 17, 2024
1 parent a7f4ce0 commit 49d5ab8
Show file tree
Hide file tree
Showing 38 changed files with 2,343 additions and 1,091 deletions.
8 changes: 4 additions & 4 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackArguments: false
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
Expand All @@ -47,8 +47,8 @@ BreakBeforeBraces: Stroustrup
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakConstructorInitializersBeforeComma: true
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 160
Expand All @@ -67,7 +67,7 @@ ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ jobs:
uses: ros-tooling/[email protected]
with:
required-ros-distributions: ${{ matrix.ros_distribution }}
- name: Use gcc 13 and g++ 13
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-13 g++-13
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100 --slave /usr/bin/g++ g++ /usr/bin/g++-13
sudo update-alternatives --config gcc
- name: Build and test ROS 2 packages
uses: ros-tooling/[email protected]
id: action_ros_ci_step
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.vscode
.vscode
build/*
install/*
log/*
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Vortex VKF
## Introduction
This is a C++ library for state estimation.
This is a C++ library for state estimation. VKF stands for Visual Kalman Filter which is a stupid and misleading name

## Packages
### vortex-filtering
Currently, it has a pure C++ implementation of the Unscented Kalman Filter (UKF) and the Extended Kalman Filter (EKF) as well as model
[More info](vortex-filtering/README.md)

- [vortex-filtering](vortex-filtering/README.md)


71 changes: 0 additions & 71 deletions docs/vkf_class_diagram.md

This file was deleted.

10 changes: 8 additions & 2 deletions vortex-filtering/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ 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
-Warray-bounds # For better array bounds error messages
)
endif()

Expand All @@ -32,7 +34,11 @@ find_package(Boost REQUIRED
filesystem
) # for gnuplot

# = Specify dependencies

# === Include directories ===
include_directories(include)

# = Specify the dependencies
set(lib_deps
Eigen3
OpenMP
Expand Down Expand Up @@ -84,8 +90,8 @@ install(
DESTINATION include
)

# === Build tests ===
if(BUILD_TESTING)
# add_compile_definitions(GNUPLOT_ENABLE=1)
add_subdirectory(test)
endif()

Expand Down
70 changes: 69 additions & 1 deletion vortex-filtering/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,72 @@ Contains the models used in the filters. The models are implemented as classes t
Contains the filters. The filters are implemented as classes that inherit from the `KalmanFilterBase` class. The filters are implemented in the `filters` namespace. [More info](include/vortex_filtering/filters/README.md)

## Class Diagram
![Class Diagram](../docs/vkf_class_diagram.md)

```mermaid
classDiagram
DynamicModel <|-- DynamicModelLTV
SensorModel <|-- SensorModelLTV
DynamicModelLTV <|-- ConstantVelocity
DynamicModelLTV <|-- ConstantAcceleration
DynamicModelLTV <|-- CoordinatedTurn
EKF -- DynamicModelLTV
EKF -- SensorModelLTV
UKF -- DynamicModel
UKF -- SensorModel
class EKF{
+predict()
+update()
+step()
}
class UKF{
+predict()
+update()
+step()
-get_sigma_points()
-propagate_sigma_points_f()
-propagate_sigma_points_h()
-estimate_gaussian()
}
class DynamicModel{
+virtual f_d() Vec_x
+virtual Q_d() Mat_vv
+sample_f_d() Vec_x
}
class SensorModel{
+virtual h() Vec_z
+virtual R() Mat_ww
+sample_h() Vec_z
}
class DynamicModelLTV {
+overide f_d() Vec_x
+virtual A_d() Mat_xx
+virtual Q_d() Mat_vv
+vurtual G_d() Mat_xv
+pred_from_est() Gauss_x
+pred_from_state() Gauss_x
}
class SensorModelLTV {
+override h(x) Vec_z
+virtual R(x) Mat_ww
+virtual C(x) Mat_zx
+virtual H(x) Mat_zw
+pred_from_est(x_est) Gauss_z
+pred_from_state(x) Gauss_z
}
class ConstantVelocity
class CoordinatedTurn
class ConstantAcceleration
```
Loading

0 comments on commit 49d5ab8

Please sign in to comment.