A reusable, unified, and highly optimized IMU framework for F1TENTH.
- ROS-Independent Core: The driver logic is completely isolated in a pure C++17 library.
- Unified Interface: Supports multiple IMUs (ICM-20948, BMI160) through a simple
DriverFactory. - Zero-Allocation Fast Loop: Specifically designed for 200–400 Hz output with minimal CPU overhead.
- Midpoint Timestamping: Captures
steady_clockbefore and after the I²C read transaction for accurate timing. - Clean Output: Publishes strictly
sensor_msgs/Imuon/imu/data_raw(REP-145). Orientation estimation must be performed externally viaimu_filter_madgwickorrobot_localization.
Rule: The driver layer (
coreanddrivers) must never include ROS headers (#include <rclcpp/rclcpp.hpp>). This enforces strict separation between hardware logic and the ROS application.
colcon build --packages-select imu_ros2ros2 launch imu_ros2 imu_launch.pyA standalone (ROS-independent) tool is provided to compute the gyroscope bias quickly:
ros2 run imu_ros2 calibrate_gyro icm20948 /dev/i2c-7 0x68Add the outputs to your YAML file!