ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

RTAB-Map using isaac_ros_visual_odometry

asked 2022-02-17 09:27:22 -0600

TurBot gravatar image

updated 2022-02-19 07:35:25 -0600

Hi there. In order to get some hardware acceleration I want to use the isaac_ros_visual_odometry package as a replacement for the rgbd_odometry node of rtabmap_ros. Now the rgbd_odometry node publishes the /odom informations, which in turn are required by rtabmap. isaac_ros_visual_odometry publishes the information in its own format, giving translation and rotation values in x,y,z direction. So unless I'm very much mistaken the information needed is present.

Is there any known procedure on how to transpose an IMU-like message to an odometry message format or else, has anyone tried a similar approach to hardware acceleration before and has had some experience on integrating the isaac-ros GEMS to rtabmap?

Ubuntu 20.04 ROS2 Foxy Nvidia Isaac GEMS for ROS

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-02-27 19:15:07 -0600

matlabbe gravatar image

Hi,

you can use tf directly to get odometry by setting odom_frame_id. Here is an example with a zed2 camera (set those lines to false to avoid zed tf) based on this example:

ros2 launch zed_wrapper zed2.launch.py
ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 1 base_link_smooth base_link
ros2 launch isaac_ros_visual_odometry isaac_ros_visual_odometry_zed2.launch.py

ros2 launch rtabmap_ros rtabmap.launch.py \
    rtabmap_args:="--delete_db_on_start" \
    rgb_topic:=/zed2/zed_node/rgb/image_rect_color \
    depth_topic:=/zed2/zed_node/depth/depth_registered \
    camera_info_topic:=/zed2/zed_node/rgb/camera_info \
    frame_id:=base_link \
    odom_frame_id:=odom \
    odom_tf_angular_variance:=0.001 \
    odom_tf_linear_variance:=0.001 \
    visual_odometry:=false \
    approx_sync:=false \
    wait_imu_to_init:=true \
    imu_topic:=/zed2/zed_node/imu/data \
    qos:=1 \
    rviz:=true

When using odometry from tf, we don't have a covariance, so we can adjust the fixed covariance with odom_tf_angular_variance and odom_tf_linear_variance parameters.

cheers,
Mathieu

edit flag offensive delete link more

Comments

Thanks a heap. I'm using a Realsense but I suppose I shall be able to port the example. I had tried to read the information from TF and build/calculate and publish an odometry message from it, but your suggestion is what I looked for: a clean and straightforward ROSish method instead of a ramshackle workaround.

Edit: http://wiki.ros.org/navigation/Tutori... I was following this link in building the odometry message. Since /visual_odometry/imu topic appears to be empty but /visual_odometry/tf_stamped is not, this seemed the way to go.

However: now I am using /imu topic directly from camera and working on including the orientation from /visual_odometry/tf_stamped, since /imu has accelerations but not orientation ... apart form getting things to work I want it to be a clean approach as well

TurBot gravatar image TurBot  ( 2022-02-28 01:38:38 -0600 )edit

Since /imu doesn't contain the orientation I start a separate node which collects orientation data from the /visual_odometry/tf_stamped topic then publishes /imu_pub, containing orientation and velocity/acceleration informations from the original /imu.

However, on running ros2 launch rtabmap_ros realsense_d400.launch.py \ rtabmap_args:="--delete_db_on_start" \ depth_topic:=/camera/aligned_depth_to_color/image_raw \ rgb_topic:=/camera/color/image_raw \ camera_info_topic:=/camera/color/camera_info \ odom_topic:=/odom_pub imu_topic:=/imu_pub \ frame_id:=base_link \ odom_frame_id:=odom \ odom_tf_angular_variance:=0.001 \ odom_tf_linear_variance:=0.001 \ visual_odometry:=false \ approx_sync:=true \ wait_imu_to_init:=true \ qos:=1 \ rviz:=true

I get the following error: CoreWrapper.cpp:2478::imuAsyncCallback() IMU received doesn't have orientation set, it is ignored.

I don't understand why ROS doesn't "see" the information.

TurBot gravatar image TurBot  ( 2022-03-02 03:15:30 -0600 )edit

Look at the D400 examples here: http://wiki.ros.org/rtabmap_ros/Tutor..., to compute the quaternion of D400 imu message, we use imu_filter_madgwick:

rosrun imu_filter_madgwick imu_filter_node \
    _use_mag:=false \
    _publish_tf:=false \
    _world_frame:="enu" \
    /imu/data_raw:=/camera/imu \
    /imu/data:=/rtabmap/imu
matlabbe gravatar image matlabbe  ( 2022-03-06 22:37:43 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2022-02-17 09:27:22 -0600

Seen: 390 times

Last updated: Feb 27 '22