Production-quality C++ robotics system demonstrating sensor fusion with Extended Kalman Filter for industrial automation applications.
Multi-sensor fusion system combining IMU and Lidar data using an Extended Kalman Filter to provide accurate, real-time robot pose estimation. Built entirely in C++ using ROS 2, demonstrating professional robotics development practices.
Key Features:
- β 4 ROS 2 nodes in C++ (880+ lines)
- β Extended Kalman Filter for sensor fusion
- β Real-time performance (50 Hz prediction rate)
- β Safety monitoring and validation
- β Professional code structure
βββββββββββββββ
β IMU Sensor β C++ Node (100 Hz)
β ββββ
βββββββββββββββ β
β
βββββββββββββββ β ββββββββββββββββββββ βββββββββββββββββββ
βLidar Sensor β ββββββ Fusion Node ββββββ Safety Monitor β
β β β β (Kalman Filter) β β β
βββββββββββββββ β β 50 Hz β βββββββββββββββββββ
β ββββββββββββββββββββ
Data Flow:
- IMU provides angular velocity and linear acceleration
- Lidar provides position measurements
- Fusion node combines both using Kalman Filter
- Safety monitor validates output
- ROS 2 Humble
- Docker (recommended for macOS/Windows)
- C++17 compiler
- Eigen3 library
# Clone repository
git clone https://github.com/AsadRahu60/sensor-fusion-system.git
# Using Docker (recommended)
docker run -it -v $(pwd):/root/ros2_ws osrf/ros:humble-desktop /bin/bash
# Inside Docker
cd /root/ros2_ws
source /opt/ros/humble/setup.bash
colcon build --packages-select sensor_fusion_system
source install/setup.bashTerminal 1 - IMU Sensor:
ros2 run sensor_fusion_system imu_sensor_nodeTerminal 2 - Lidar Sensor:
ros2 run sensor_fusion_system lidar_sensor_nodeTerminal 3 - Fusion Node:
ros2 run sensor_fusion_system fusion_nodeTerminal 4 - Safety Monitor:
ros2 run sensor_fusion_system safety_monitor_node# Check active topics
ros2 topic list
# Monitor data rates
ros2 topic hz /imu/data # ~100 Hz
ros2 topic hz /lidar/scan # ~10 Hz
ros2 topic hz /fusion/pose # ~50 Hz
# View live data
ros2 topic echo /fusion/posex = [x, y, ΞΈ, vx, vy, Ο]α΅
- Position: (x, y) in meters
- Orientation: ΞΈ in radians
- Linear velocity: (vx, vy) in m/s
- Angular velocity: Ο in rad/s
Prediction Step (50 Hz):
x_predicted = F * x_previous
P_predicted = F * P * F^T + QUpdate Step (Asynchronous):
K = P * H^T * (H * P * H^T + R)^(-1)
x_updated = x_predicted + K * (z - H * x_predicted)
P_updated = (I - K * H) * P_predicted- Modern C++17: Smart pointers, RAII, lambdas
- Eigen Library: Efficient matrix operations
- Multiple Subscribers: Handles asynchronous sensor data
- Real-time Performance: Optimized for embedded systems
sensor_fusion_system/
βββ src/
β βββ sensors/
β β βββ imu_sensor_node.cpp # IMU publisher (100 Hz)
β β βββ lidar_sensor_node.cpp # Lidar publisher (10 Hz)
β βββ fusion/
β β βββ fusion_node.cpp # Kalman Filter (50 Hz)
β βββ safety/
β βββ safety_monitor_node.cpp # Safety validation
βββ launch/
β βββ sensor_fusion_system.launch.py
βββ config/
β βββ params.yaml
βββ package.xml
βββ CMakeLists.txt
βββ README.md
- Object-oriented design with inheritance
- Smart pointers (std::shared_ptr, std::unique_ptr)
- RAII pattern for resource management
- Lambda functions for callbacks
- Template programming (Eigen matrices)
- Const correctness
- Extended Kalman Filter implementation
- Multi-rate sensor fusion
- Covariance propagation
- Real-time system design
- Safety-critical validation
- Professional code structure
- CMake build system
- ROS 2 best practices
- Clear documentation
cd ~/ros2_ws
colcon build --packages-select sensor_fusion_system --symlink-installfind src -name "*.cpp" -o -name "*.hpp" | xargs clang-format -iThis project demonstrates concepts from:
- ROS 2 Documentation: https://docs.ros.org/en/humble/
- Eigen Library: https://eigen.tuxfamily.org/
- Kalman Filtering: Probabilistic Robotics (Thrun, Burgard, Fox)
Asadullah Rahoo
M.Sc. Robotics Student @ TH Deggendorf
Email: asadullahrahoo98@gmail.com
GitHub: (https://github.com/asadrahu60)
MIT License - See LICENSE file for details
- ROS 2 Humble community
- Eigen library developers
- TH Deggendorf Robotics Program
Status: β
Fully Functional
Build: β
Passing
Tested: β
All 4 nodes verified
Built as portfolio project demonstrating C++ robotics development for embedded systems roles.
β If you find this project useful, please consider giving it a star!