Skip to content

[ROS2][feat] Enable IMU sensor

Tong Fu requested to merge ROS2/feat/EnableIMUSensor into feat/ROS2

Goal

Enable the reception of IMU messages so that the gravity constraint can be used in ros wrapping.

Changes

  • A function called ImuCallback is added to LidarSlamNode in ros wrapping. It adds imu accelerations into GravityManager.

Results

Commands to reproduce the results

  • Change the parameters :
    • imu/enable=true
    • imu/gravity_weight=100.
ros2 launch lidar_slam slam_ouster.py
ros2 bag play --clock path/to/ouster_bag_with_imu.bag

Note: when play the rosbag, check the topic name of points and imu. If they are different from /ouster/points and /imu, change the topic name by using the following command:

ros2 bag play --clock path/to/ouster_bag_with_imu.bag /os_cloud_node/points:=/ouster/points /os_cloud_node/imu:=/imu

Results

Here is an image to show an acceleration vector on axis_Z dans frame gravity. The direction of this vector is perpendicular to the floor.

Screenshot_from_2023-11-16_13-25-26

What remains to solve

  • Add info display and update comment on line200 in LidarSlamNode.cxx after other MRs merged
  • Result on ros1 is different with on ros2
  • Appropriate data to test imu gravity feature
Edited by Tong Fu

Merge request reports