A professional-grade Extended Kalman Filter (EKF) for 2D autonomous vehicle state estimation. This package fuses IMU data (acceleration and yaw rate) with hardware velocity encoders to provide a smooth, continuous, zero-latency odometry estimate.
This repository is strictly designed using the Wrapper Pattern to ensure maximum portability, testability, and hardware agnosticism. It is split into two distinct layers:
A pure, vanilla C++ library powered by Eigen3.
- Zero Middleware: Contains absolutely no ROS 2 dependencies.
- Portability: Can be compiled directly into proprietary middleware, embedded systems, or bare-metal microcontrollers tomorrow.
- Math: Implements a dynamic non-holonomic kinematic bicycle model, predicting state via IMU integration and applying measurement updates via high-frequency velocity data.
A lightweight ROS 2 interface that handles the TF trees, ROS parameter servers, and message serialization.
- Hardware Agnostic: Subscribes to standard
geometry_msgs::msg::TwistStampedrather than simulator-specific joint states. This node can be dropped into any robot (drones, rovers, autonomous racecars) that publishes standard ROS velocity topics. - Configurable: Uses ROS parameters to define dynamic TF frames (
odom->base_link).
imu/data(sensor_msgs/Imu): Raw IMU data. The node internally passes this through a Low-Pass Filter (LPF) to eliminate physical hardware vibration and chassis jitter.vehicle/velocity(geometry_msgs/TwistStamped): The measured forward velocity from wheel encoders or external sensors.~/reset(std_msgs/Empty): Resets the EKF covariance and state matrices back to origin.
odometry/filtered(nav_msgs/Odometry): The fused, high-frequency state estimate.tf: Broadcasts the transform fromodom_frametobase_frame.
| Parameter | Type | Default | Description |
|---|---|---|---|
odom_frame |
string |
"odom" |
The parent coordinate frame. |
base_frame |
string |
"base_link" |
The child coordinate frame attached to the robot. |
publish_tf |
bool |
true |
Whether the node should actively broadcast to /tf. |
- OS: Ubuntu 22.04
- Middleware: ROS 2 Humble
- Math Library:
Eigen3
To install Eigen locally:
sudo apt-get update
sudo apt-get install libeigen-dev