VINS odometry integration with RTABMAP

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

VINS odometry integration with RTABMAP

udit
This post was updated on .
Hello Matlabbe,  
    I am trying to use RTABMAP with external odometry.  
I am able to run RTABMAP with external odometry from P3dx and results looks good.
The command which I am using is:
roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" visual_odometry:=false frame_id:=/base_link odom_topic:=/pose rviz:=false rtabmapviz:=true 
 
The problem is when I am trying to using VINS Odometry instead of p3dx wheel odometry, then I am getting the error, which is also mentioned in this thread (there it seems to be only in the starting phase of the bag file or it solved by installing RTABMAP from source, both of the solutions I tried):  
[ WARN] [1570456213.337584866]: Could not get transform from /base_link to camera_color_optical_frame after 0.200000 seconds (for stamp=1570165852.314937)! Error="Lookup would require extrapolation into the past.  Requested time 1570165852.314936769 but the earliest data is at time 1570456203.427467337, when looking up transform from frame [camera_color_optical_frame] to frame [base_link]. canTransform returned after 0.201951 timeout was 0.2.".
[ERROR] [1570456213.337637535]: TF of received image 0 at time 1570165852.314937s is not set!
[ERROR] [1570456213.337663827]: Could not convert rgb/depth msgs! Aborting rtabmap update...

The command I am using is:  
roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" visual_odometry:=false rgb_topic:=/camera/color/image_raw depth_topic:=/camera/aligned_depth_to_color/image_raw camera_info_topic:=/camera/color/camera_info odom_topic:=/odom_rect frame_id:=/base_link rviz:=true rtabmapviz:=false
 
And tf tree is:  


I have remapped the tf frames from vins (world to body) to rtabmap(odom to base_link), which is correctly shown in the above tf tree.  

Could you direct me towards source of error, which is in not there when using wheel odometry but is there  when using VINS odometry.  


Edit 1:


I have given additional parameter:
odom_frame_id:=odom
 and now the error has gone and  my map looks like this with vins odometry fusion with RTABMAP. And my full command is currently this:  
roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" visual_odometry:=false rgb_topic:=/camera/color/image_raw depth_topic:=/camera/aligned_depth_to_color/image_raw camera_info_topic:=/camera/color/camera_info odom_topic:=/odom_rect frame_id:=/base_link rviz:=false rtabmapviz:=true odom_frame_id:=odom
   
1. Could you suggest the problem in the current map? One problem which might be is the wrong calibration between vins mono and RTABMAP (could you suggest some ways to correct the calibration).  
2. Why the background is getting red (indicator of lost odometry), since I have seen this problem with visual odometry only and not with external odometry?  
However with just visual odometry I am able to get a very good map for the same bag file, but I dont want to rely on visual odometry as my main use case is for outdoor drones.  

Thanks,
Udit
Reply | Threaded
Open this post in threaded view
|

Re: VINS odometry integration with RTABMAP

matlabbe
Administrator
Hi,

In the first video, I saw a jump at 0:13, make sure you have only one node publishing on TF for odometry.

For VINS video, I think the trajectory may be good, but it seems there is an optical rotation missing. Maybe VINS outputs poses in camera optical frame coordinate, not in base frame coordinate.

For convenience, if you have built VINS-FUSION, you can build rtabmap from source with its support, so that you can use VINS inside rtabmap (--Odom/Strategy 9). The frames would be already correct. Take a look at this example:
https://github.com/introlab/rtabmap_ros/blob/master/launch/tests/test_d435i_vio.launch

cheers,
Mathieu