rtabmap_ros icon indicating copy to clipboard operation
rtabmap_ros copied to clipboard

how to use the vins as an Odom in rtabmap?

Open kenan9875645 opened this issue 1 year ago • 4 comments

hello introlab , I'm just a newbee and a small student, want to learn how to use your great work rtabmap to build my own map . I just learned using vins-fusion with d435i, it can provide a VIO Odom. And I want to use this odom to guide my rtabmap building a great map. I learned that the rtabmap can build with vins , but I tried a lot, it failed many times, I just gave up.......... I build the rtabmap and rtabmap_ros with apt-get install, and it works well in the euroc dataset. But the rtabmap build with apt is not able to use the vins together.... in another hand, I find the rtabmap can recive "Odom" as the input odom to guide the mapping. So I change the rtabmap-ros launch file as this: `

<arg name="clip_distance"             default="-2"/>
<arg name="use_rviz"                  default="true"/>
<arg name="use_rtabmapviz"            default="false"/>
<include file="$(find rtabmap_ros)/launch/rtabmap.launch">
        <arg name="rtabmap_args"       value="--delete_db_on_start"/>
        <arg name="depth_topic"        value="/camera/aligned_depth_to_color/image_raw"/>
        <arg name="frame_id"           value="camera_link"/>
        <arg name="visual_odometry"    value="false"/>
        <arg name="odom_topic"         value="/vins_estimator/odometry"/>
        <arg name="rgb_topic"          value="/camera/color/image_raw"/>
        <arg name="camera_info_topic"  value="/camera/color/camera_info"/>
        <arg name="queue_size"         value="200"/>
        <arg name="rviz"               value="$(arg use_rviz)"/>
        <arg name="rtabmapviz"         value="$(arg use_rtabmapviz)"/>
</include>

` which the vins odom topic is "/vins_estimator/odometry", and just use d435i as my camera. And I tried run vins and rtabmap-ros together I can get VIO Odom well, but the rtabmap-ros output like this 2023-03-15 17-52-20 的屏幕截图 and the map is like this: 2023-03-15 12-31-02 的屏幕截图 it seems that the tf tree is not set well and the map can not fusion together. And in rtabmapviz, it seems that the camera does not move, it holds on in the start point(although rviz the camera is move in the world frame).
how can I get the correct tf between world and map? or how to use the vins in the rtabmap? what the odom frame means about?

kenan9875645 avatar Mar 16 '23 09:03 kenan9875645

Hi,

The frame_id of rtabmap should be set to child_frame_id set in vins odometry topic (/vins_estimator/odometry).

Which frames VINS is published? Can you show the tf tree? rosrun tf2_tools view_frames.py

matlabbe avatar Apr 02 '23 22:04 matlabbe

Hi,

The frame_id of rtabmap should be set to child_frame_id set in vins odometry topic (/vins_estimator/odometry).

Which frames VINS is published? Can you show the tf tree? rosrun tf2_tools view_frames.py

Hello! I just learned that it may be the tf_tree not connect correctly. After running rosrun tf2_ tools view_ Frames.py, the following results appear: 2023-04-03 21-19-50 的屏幕截图

And this time, I run with the d455 (the effect should be the same as the d435i), and then after changing the value of frame_id to body, with the pkg static_transformer node like this(The content of the launch file here is as follows:): 2023-04-03 21-56-43 的屏幕截图

,the result of running rtabmap_vins is shown in the left figure: 2023-04-03 20-27-06 的屏幕截图

There is no yellow warning.

2023-04-03 20-20-26 的屏幕截图

However, it seems that the desired effect has not been achieved, which means that the established diagrams are still not well integrated. is there something wrong?

kenan9875645 avatar Apr 03 '23 13:04 kenan9875645

One issue sometimes with other packages is that they provide odometry in camera optical frame (x->left, y->down, z->forward) instead of ros standard (x->forward, y->left, z->up). Even before trying rtabmap, you could launch VINS alone, open RVIZ, add a DepthCloud display, set an history of some seconds and move the camera to make sure the point clouds overlap correctly.

matlabbe avatar Apr 16 '23 01:04 matlabbe

Hello, can you share how to use vins as odom in rtabmap? I also use a d435i camera, thank you (ಥ_ಥ)

tulingcheng86 avatar Mar 12 '24 07:03 tulingcheng86