How to generate maps with same odometry and different parameter values from ubuntu commandline?

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

How to generate maps with same odometry and different parameter values from ubuntu commandline?

MalarJN
Hi,

I have used the simulation section of this tutorial to generate a 2D map using a simulated version of turtlebot2 in Gazebo and rtabmap. Now I want to change the rtabmap parameters (like MaxDepth) to see if there are any changes to the map. I realise this can be done using the rtabmap databaseViewer GUI (though I am not sure how), however because I would like to try multiple values  for multiple parameters  and different combinations of these as well. I want to know if there is a way this can be done using the commandline in Ubuntu?  

PS: I am using ROS kinetic on an Ubuntu 16.04 VM.

Thanks,
Malar.
Reply | Threaded
Open this post in threaded view
|

Re: How to generate maps with same odometry and different parameter values from ubuntu commandline?

matlabbe
Administrator
Hi,

You can use rtabmap-reprocess tool. Example to try with Vis/MaxDepth set to 10 and 5:

$ rtabmap-reprocess --Vis/MaxDepth 10 input.db output10.db
$ rtabmap-reprocess --Vis/MaxDepth 5 input.db output5.db

For Grid/ parameters, a convenient way is to open the database in DatabaseViewer, open Core Parameters panel, change Grid/ parameters and do Edit->Regenerate local grid maps.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: How to generate maps with same odometry and different parameter values from ubuntu commandline?

MalarJN
Thank you very much Mathieu, that worked. However, now when I use the commands I regularly use to generate the map, no matter what database path I specify, the rtabmap.db file in .ros folder is accessed.

rosrun rtabmap_ros rtabmap _database_path:=
rosrun map_server map_saver map:=grid_map
rosservice call /publish_map 1 1 0


Regards,
Malar.
Reply | Threaded
Open this post in threaded view
|

Re: How to generate maps with same odometry and different parameter values from ubuntu commandline?

matlabbe
Administrator
Hi,

The database_path is not set on your line. I tried this and it should work:
rosrun rtabmap_ros rtabmap _database_path:=~/my_map.db
[ INFO] [1602085325.622792769]: Starting node...
[ INFO] [1602085325.699695432]: Initializing nodelet with 12 worker threads.
[ INFO] [1602085325.892238053]: /rtabmap(maps): map_filter_radius          = 0.000000
[ INFO] [1602085325.892259843]: /rtabmap(maps): map_filter_angle           = 30.000000
[ INFO] [1602085325.892266272]: /rtabmap(maps): map_cleanup                = true
[ INFO] [1602085325.892271333]: /rtabmap(maps): map_always_update          = false
[ INFO] [1602085325.892276377]: /rtabmap(maps): map_empty_ray_tracing      = true
[ INFO] [1602085325.892311013]: /rtabmap(maps): cloud_output_voxelized     = true
[ INFO] [1602085325.892317257]: /rtabmap(maps): cloud_subtract_filtering   = false
[ INFO] [1602085325.892323984]: /rtabmap(maps): cloud_subtract_filtering_min_neighbors = 2
[ INFO] [1602085325.892696043]: /rtabmap(maps): octomap_tree_depth         = 16
[ INFO] [1602085325.903220779]: rtabmap: frame_id      = base_link
[ INFO] [1602085325.903237288]: rtabmap: map_frame_id  = map
[ INFO] [1602085325.903248295]: rtabmap: use_action_for_goal  = false
[ INFO] [1602085325.903261893]: rtabmap: tf_delay      = 0.050000
[ INFO] [1602085325.903271935]: rtabmap: tf_tolerance  = 0.100000
[ INFO] [1602085325.903281218]: rtabmap: odom_sensor_sync   = false
[ INFO] [1602085326.484243278]: RTAB-Map detection rate = 1.000000 Hz
[ INFO] [1602085326.484287861]: rtabmap: Using database from "/home/mathieu/my_map.db" (0 MB).
[ INFO] [1602085326.503072458]: rtabmap: Database version = "0.20.5".
[ INFO] [1602085326.514452830]: /rtabmap: subscribe_depth = true
[ INFO] [1602085326.514493190]: /rtabmap: subscribe_rgb = true
[ INFO] [1602085326.514502951]: /rtabmap: subscribe_stereo = false
[ INFO] [1602085326.514515235]: /rtabmap: subscribe_rgbd = false (rgbd_cameras=1)
[ INFO] [1602085326.514524313]: /rtabmap: subscribe_odom_info = false
[ INFO] [1602085326.514533745]: /rtabmap: subscribe_user_data = false
[ INFO] [1602085326.514544560]: /rtabmap: subscribe_scan = false
[ INFO] [1602085326.514554616]: /rtabmap: subscribe_scan_cloud = false
[ INFO] [1602085326.514562814]: /rtabmap: subscribe_scan_descriptor = false
[ INFO] [1602085326.514573485]: /rtabmap: queue_size    = 10
[ INFO] [1602085326.514585414]: /rtabmap: approx_sync   = true
[ INFO] [1602085326.514811634]: Setup depth callback
[ INFO] [1602085326.713710861]: 
/rtabmap subscribed to (approx sync):
   /odom \
   /rgb/image \
   /depth/image \
   /rgb/camera_info
[ INFO] [1602085326.804892999]: rtabmap 0.20.4 started...
See the "rtabmap: Using database from "/home/mathieu/my_map.db" (0 MB)". line.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: How to generate maps with same odometry and different parameter values from ubuntu commandline?

MalarJN
Hi Mathieu,

That is what does not work for me. Take a look at this for example:

rosrun rtabmap_ros rtabmap _database_path=/home/malar/overlay_ws/RoboticsLabRuns/Default/output2.db
[ INFO] [1602098304.918545862]: Starting node...
[ INFO] [1602098305.239313980]: Initializing nodelet with 2 worker threads.
[ INFO] [1602098306.505667985]: /rtabmap(maps): map_filter_radius          = 0.000000
[ INFO] [1602098306.505728860]: /rtabmap(maps): map_filter_angle           = 30.000000
[ INFO] [1602098306.506048451]: /rtabmap(maps): map_cleanup                = true
[ INFO] [1602098306.506121185]: /rtabmap(maps): map_always_update          = false
[ INFO] [1602098306.506567446]: /rtabmap(maps): map_empty_ray_tracing      = true
[ INFO] [1602098306.506628762]: /rtabmap(maps): cloud_output_voxelized     = true
[ INFO] [1602098306.507036725]: /rtabmap(maps): cloud_subtract_filtering   = false
[ INFO] [1602098306.507103294]: /rtabmap(maps): cloud_subtract_filtering_min_neighbors = 2
[ INFO] [1602098306.514108684]: /rtabmap(maps): octomap_tree_depth         = 16
[ INFO] [1602098306.603270831]: rtabmap: frame_id      = base_link
[ INFO] [1602098306.603380585]: rtabmap: map_frame_id  = map
[ INFO] [1602098306.603449202]: rtabmap: use_action_for_goal  = false
[ INFO] [1602098306.603550173]: rtabmap: tf_delay      = 0.050000
[ INFO] [1602098306.603646694]: rtabmap: tf_tolerance  = 0.100000
[ INFO] [1602098306.603713221]: rtabmap: odom_sensor_sync   = false
[ INFO] [1602098308.595015806]: Update RTAB-Map parameter "Grid/FromDepth"="false" from database
[ INFO] [1602098308.595458409]: Update RTAB-Map parameter "Grid/RangeMax"="0" from database
[ INFO] [1602098308.595722938]: Update RTAB-Map parameter "GridGlobal/MinSize"="20" from database
[ INFO] [1602098308.595952044]: Update RTAB-Map parameter "Icp/CorrespondenceRatio"="0.3" from database
[ INFO] [1602098308.596051184]: Update RTAB-Map parameter "Kp/MaxDepth"="4.0" from database
[ INFO] [1602098308.596495360]: Update RTAB-Map parameter "Mem/RehearsalSimilarity"="0.3" from database
[ INFO] [1602098308.596880353]: Update RTAB-Map parameter "Reg/Force3DoF"="true" from database
[ INFO] [1602098308.597311328]: Update RTAB-Map parameter "Vis/MinInliers"="15" from database
[ INFO] [1602098309.033383062]: RTAB-Map detection rate = 1.000000 Hz
[ INFO] [1602098309.033591847]: rtabmap: Using database from "/home/malar/.ros/rtabmap.db" (0 MB).
[ INFO] [1602098309.094005360]: rtabmap: Database version = "0.19.6".
[ INFO] [1602098309.194967361]: /rtabmap: subscribe_depth = true
[ INFO] [1602098309.195034111]: /rtabmap: subscribe_rgb = true
[ INFO] [1602098309.195063158]: /rtabmap: subscribe_stereo = false
[ INFO] [1602098309.195092908]: /rtabmap: subscribe_rgbd = false (rgbd_cameras=1)
[ INFO] [1602098309.195128032]: /rtabmap: subscribe_odom_info = false
[ INFO] [1602098309.195155276]: /rtabmap: subscribe_user_data = false
[ INFO] [1602098309.195181317]: /rtabmap: subscribe_scan = false
[ INFO] [1602098309.195207133]: /rtabmap: subscribe_scan_cloud = false
[ INFO] [1602098309.195234110]: /rtabmap: queue_size    = 10
[ INFO] [1602098309.195272092]: /rtabmap: approx_sync   = true
[ INFO] [1602098309.195363967]: Setup depth callback
[ INFO] [1602098309.298579640]:
/rtabmap subscribed to (approx sync):
   /odom,
   /rgb/image,
   /depth/image,
   /rgb/camera_info
[ INFO] [1602098309.356909748]: rtabmap 0.19.6 started...

Note where I mention the database path and where in the logs it has been directed to the default rtabmap.db.

Best regards,
Malar.
Reply | Threaded
Open this post in threaded view
|

Re: How to generate maps with same odometry and different parameter values from ubuntu commandline?

MalarJN
This post was updated on .
It seems to work with the newer version of RTABMap. Also, I seem to have missed the ':' when specifying the database path.
Reply | Threaded
Open this post in threaded view
|

Re: How to generate maps with same odometry and different parameter values from ubuntu commandline?

matlabbe
Administrator
Yeah it should be indeed (colon-equal):
rosrun rtabmap_ros rtabmap _database_path:=/home/malar/overlay_ws/RoboticsLabRuns/Default/output2.db
Reply | Threaded
Open this post in threaded view
|

Re: How to generate maps with same odometry and different parameter values from ubuntu commandline?

MalarJN
Thank you Mathieu.

I understand that the Kp/MaxDepth parameter is used to filter extracted keypoints by depth. However, I was wondering what happens when I change the Kp/MaxDepth parameter values? For example, what does changing it do to the map generated?

Best regards,
Malar.
Reply | Threaded
Open this post in threaded view
|

Re: How to generate maps with same odometry and different parameter values from ubuntu commandline?

matlabbe
Administrator
This will change how loop closures are detected, thus trajectory may be different if loop closures are more or less detected because of this.
Reply | Threaded
Open this post in threaded view
|

Re: How to generate maps with same odometry and different parameter values from ubuntu commandline?

MalarJN
Thank you very much Mathieu.