ROS 2 C++ implementation of Extended Kalman filter (EKF) and Unscented Kalman filter (UKF) with demo nodes.
This repository is ROS 2-based and utilises several dependencies that are common in robotics applications. Follow the instructions below to build the package in a ROS 2 environment.
Make sure you have the following installed:
- ROS 2 humble: Installed and properly sourced. Follow the ROS 2 installation guide if you haven't set it up yet.
- C++17 Compiler: Ensure your compiler supports C++17.
- Dependencies: The package depends on several libraries and ROS 2 packages.
Eigen3
- ROS 2 packages:
rclcpp
Clone this repo into your ROS 2 workspace, install dependencies, and build pkg:
cd ~/ros2_ws/src && git clone https://github.com/wei-hsuan-cheng/kf_cpp.git
cd ~/ros2_ws && rosdep update && rosdep install --from-paths src --ignore-src -r -y
cd ~/ros2_ws && colcon build --packages-select kf_cpp && . install/setup.bash
Run the ROS 2 node for test:
cd ~/ros2_ws && . install/setup.bash
ros2 run kf_cpp ukf_ori_sim
The table below compares the process of each filter in each iteration.
- EKF:
- [1]
- UKF:
-
[1] Rudolph Van der Merwe. "Sigma-Point Kalman Filters for Probabilistic Inference in Dynamic State-Space Models" dissertation (2004).
-
[2] Simon J. Julier. "The Scaled Unscented Transformation". Proceedings of the American Control Conference 6. IEEE. (2002)
-
[3] http://www.esdradar.com/brochures/Compact%20Tracking%2037250X.pdf
-
[4] Julier, Simon J.; Uhlmann, Jeffrey "A New Extension of the Kalman Filter to Nonlinear Systems". Proc. SPIE 3068, Signal Processing, Sensor Fusion, and Target Recognition VI, 182 (July 28, 1997)
-
[5] Cholesky decomposition. Wikipedia. http://en.wikipedia.org/wiki/Cholesky_decomposition
-
- Kalman-and-Bayesian-Filters-in-Python: The EKF algorithm is an C++ implementation adapted from the Kalman-and-Bayesian-Filters-in-Python.
- hdl-localization-ROS2: The UKF algorithm is adapted from the hdl-localization-ROS2 codebase.
- Robot Math Utils: Some utilities from Robot Math Utils are used.
- Eigen Library: This library heavily relies on the Eigen library for linear algebra operations.
- Author: Wei-Hsuan Cheng ([email protected])
- Homepage: wei-hsuan-cheng
- GitHub: wei-hsuan-cheng