How brukg/pose-ekf-slam works
Project type and purpose
• This is a ROS (Robot Operating System) package (C++ + Python) implementing an Extended Kalman Filter for pose-SLAM using odometry and LiDAR.
• Purpose: subscribe to odom and laser scans, run EKF-SLAM backend, publish estimated pose and map data.
File structure
Top level:
– CMakeLists.txt & package.xml: ROS build and meta-information
– launch/pekf_slam.launch.py: ROS2 launch script (brings up nodes, parameter server)
– params/param.yaml: EKF and topic parameters
– include/pekf_slam/*.hpp & src/*.cpp:
• pekf_slam.hpp / utils.hpp – core EKF logic and helpers
• pekf_slam.cpp – core algorithm implementation
• pekf_slam_node.cpp – ROS node wrapper (subscriptions, publishers)
– scripts/scan2pc.py: Python helper converting LaserScan → PointCloud2
README for additional insights
• Confirms odom + lidar inputs, EKF approach, and simulation results.
Main components
A. ROS Master / ROS Domain
– Manages node registration, parameter server (loads params/param.yaml)
B. Sensor interfaces
– /odom topic publisher (robot base odometry)
– /scan topic publisher (LiDAR scan)
– scan2pc.py node (optional helper)
C. pekf_slam_node
– Subscribes to /odom and /scan (or /pointcloud if using scan2pc)
– Loads parameters from ROS param server
– Calls core EKF module
– Publishes estimated pose (e.g. /ekf_pose) and map updates (if implemented)
– Broadcasts TF transforms (map → odom → base_link)
D. Core EKF library
– State prediction & update, covariance propagation
– Utility functions (data conversions, noise models)
E. Visualization / Storage (external)
– RViz or custom plot subscriber
– Optional file logging or bag recording
Relationships & interactions
• Sensors → Topics → pekf_slam_node → EKF module → Publishers → Visualization
• Parameter server feeds config to node at startup
• scan2pc.py (Python script) transforms LaserScan → PointCloud2 if needed—feeds into the same or parallel data stream
Architectural patterns & design principles
– ROS pub/sub decoupling: each component is a node with well-defined topics
– Separation of concerns: core SLAM algorithm (pekf_slam.hpp/.cpp) is independent of ROS
– Parameterization via YAML and launch file for flexible tuning
– Modular helper scripts (scan2pc.py) for preprocessing
Technologies & frameworks
• ROS2 (implied by .launch.py)
• C++17 for performance-critical EKF
• Python3 for quick prototyping (scan2pc)
• CMake build system & ament (or catkin)
• YAML for configuration