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

Feature/better imm filter #8

Merged
merged 38 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
9e4078e
started on new IMM filter
EirikKolas Jan 21, 2024
78a955e
more changes...
EirikKolas Jan 22, 2024
c5652e8
progress
EirikKolas Jan 30, 2024
15b4870
made changes outlined in @chrstrom's PR review
EirikKolas Jan 30, 2024
4dad588
Committing clang-format changes
Jan 30, 2024
fe6cac3
started on new IMM filter
EirikKolas Jan 21, 2024
b75556a
more changes...
EirikKolas Jan 22, 2024
0c0abe8
progress
EirikKolas Feb 12, 2024
d744d29
changed state name system. Almost compiles
EirikKolas Feb 19, 2024
c34d992
Added ostream operator for MultivarGauss.
EirikKolas Mar 3, 2024
6fb024c
added support for specifying min and max state values
EirikKolas Mar 4, 2024
d02317a
rebased from main
EirikKolas Mar 4, 2024
2861acb
fixed size error in imm mixing
EirikKolas Mar 4, 2024
4e2751c
Committing clang-format changes
Mar 4, 2024
41e12aa
todo: pass state_names_ to mixing in imm filter
EirikKolas Mar 4, 2024
66fa253
imm filter done!
EirikKolas Mar 5, 2024
ca4d142
mixing doesn't work as expectd
EirikKolas Mar 5, 2024
dc4d814
fixed imm mixing probs calculation
EirikKolas Mar 6, 2024
7d4c2fe
updated documentation
EirikKolas Mar 8, 2024
3c4abcd
updated documentation
EirikKolas Mar 8, 2024
ea8406f
Update documentation
EirikKolas Mar 8, 2024
028a5ab
updated readmes
EirikKolas Mar 8, 2024
6910e08
fixed readme
EirikKolas Mar 10, 2024
077df75
changed DynMod to DynModPtr across the package
EirikKolas Mar 8, 2024
ae0ceb3
fixed model getters in imm model
EirikKolas Mar 8, 2024
a8f6c06
fixed const get_model of imm
EirikKolas Mar 8, 2024
41f95f4
change gnuplot enable to check value of define
EirikKolas Mar 10, 2024
f4eef65
created classes for types based on macros
EirikKolas Mar 10, 2024
d373ba5
refactored ekf
EirikKolas Mar 10, 2024
e360974
started changing all the types
EirikKolas Mar 11, 2024
18a4496
Changed all except imm test
EirikKolas Mar 13, 2024
909bb14
Finished converting all types. All tests pass
EirikKolas Mar 14, 2024
3b1380b
made a concept to check for matrix sizes
EirikKolas Mar 14, 2024
7240c4b
Removed all signs of the old DynModI and SensModI stuff
EirikKolas Mar 14, 2024
6414e89
refactored ekf and ukf to not be dependent on having sizes defined
EirikKolas Mar 16, 2024
18f9935
refactored imm model and filter to utilize ekf and ukf changes
EirikKolas Mar 16, 2024
80351f8
try to make gh action use gcc 13
EirikKolas Mar 16, 2024
6069744
fixed include and readme
EirikKolas Mar 17, 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
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
EirikKolas marked this conversation as resolved.
Show resolved Hide resolved
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
Loading