Build octomap with rtabmap?

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

Build octomap with rtabmap?

yincanben
Hello,
      Today,I try to run map_assembler to build a octomap with rtabmap,but I got a sparse map,so it isn't suited for 3D navigation,How should I change the parameters to build more dense map?
The launch file is:
<node pkg="rtabmap_ros" type="map_assembler" name="map_assembler">
</node>
<node pkg="octomap_server" type="octomap_server_node" name="octomap_server">
       
               
       
       
               
       
       
              
       
       <remap from="cloud_in" to="/rtabmap/assembled_clouds" />       
  </node>
Reply | Threaded
Open this post in threaded view
|

Re: Build octomap with rtabmap?

matlabbe
Administrator
Do you have an example (screenshot) of sparse map?

I added your lines in rgbd_mapping.launch and I can have an octomap shown in RVIZ which represents well the area I scanned.

I did another test with the database from the IROS kinect challenge. There some screenshots (assembled_cloud):



To reproduce the screenshots above, you will need the database "IROS14-kinect-challenge.db" from here.

In multiple terminals, do:
$ roscore
$ rosrun rtabmap_ros rtabmap _Mem/IncrementalMemory:=false _database_path:=IROS14-kinect-challenge.db
$ rosrun rtabmap_ros map_assembler _cloud_voxel_size:=0.05
$ rosrun octomap_server octomap_server_node cloud_in:=assembled_clouds
$ rosrun rviz rviz /rtabmap/get_map:=/get_map

RVIZ:
 * Set fixed frame to /map
 * Add PointCloud2 display (topic /assembled_clouds)
 * Add octomap_rviz_plugins/OccupancyGrid display (topic /octomap_full)

Now call rtabmap "publish_map" service, this will fill the map_assembler's cache (all 3D point clouds) so the whole map can be assembled and published to octomap_server_node:
$ rosservice call /publish_map 1 1 0

This may take some time to generate, but you should see something like in the screenshot above. I don't have a very good GPU, so on my computer showing the octomap is very slow.
Reply | Threaded
Open this post in threaded view
|

Re: Build octomap with rtabmap?

yincanben
I want to test the database from the IROS Kinect Challenge in  person,But I can't download the database in China,Can you shared some databases to github as well?Very thankful!
Reply | Threaded
Open this post in threaded view
|

Re: Build octomap with rtabmap?

yincanben
In reply to this post by matlabbe
following your advice, I increased  the value of cloud_voxel_size from 0.01 to 0.05,Now I get a more dense map.
Reply | Threaded
Open this post in threaded view
|

Re: Build octomap with rtabmap?

alexr
In reply to this post by matlabbe
Great! this tutorial worked for my database. This generates an octomap of the points from the .db file. Is it possible to produce a scan by scan visualization in rviz instead of the final pointcloud (for eg : like when playing through rosbag play for the  bagfile) if the images can be sourced at a slower rate of say 2hz??
------ Alex
Reply | Threaded
Open this post in threaded view
|

Re: Build octomap with rtabmap?

matlabbe
Administrator
You can use the data_player node to play a database (.db) over ROS at a specified rate. This node has services to pause/resume the source. Please update rtabmap_ros to latest version as I just fixed a bug in this experimental node:
$ roscd rtabmap_ros
$ git pull origin master
$ cd ../..
$ catkin_make

Here is an example with the database above:
$ roscore
$ rosrun rtabmap_ros rtabmap --delete_db_on_start _SURF/HessianThreshold:="60" _LccBow/Force2D:="true" _LccBow/InlierDistance:="0.05" _Kp/RoiRatios:="0 0 0 0.3" _LccBow/MinInliers:="3" _Kp/MaxDepth:=4
$ rosrun rtabmap_ros map_assembler _cloud_voxel_size:=0.05
$ rosrun octomap_server octomap_server_node cloud_in:=assembled_clouds
$ rosrun rviz rviz /rtabmap/get_map:=/get_map
$ rosrun rtabmap_ros data_player _database:=IROS14-kinect-challenge.db depth_registered/image:=depth/image _rate:=2
Setup RVIZ as the post above. The parameters for rtabmap node are those from the IROS Kinect challenge page. There is no documentation about the data_player node yet, you should see the source for information.

To pause/resume:
$ rosservice call /data_player/pause
$ rosservice call /data_player/resume
Reply | Threaded
Open this post in threaded view
|

Re: Build octomap with rtabmap?

alexr
This post was updated on .
Hi,

When using the command to git pull i am getting error,

(my ros package is named as rtabmap inside ~/catkin_ws/src)
P.S. I have the package from the initial release and downloaded it using the svn checkout from the googlecode page.



$ roscd rtabmap
$ git pull origin master

[ERROR] fatal: Not a git repository (or any of the parent directories): .git

what could be the reason? Should I re install the whole package from git leaving the rtabmap library intact ? what are your suggestions.

Thanks

-Alex
------ Alex
Reply | Threaded
Open this post in threaded view
|

Re: Build octomap with rtabmap?

matlabbe
Administrator
The svn code on googlecode is not maintained anymore (both the standalone library and the ros package). You should get the code from the GIT repository:
 * https://github.com/introlab/rtabmap
 * https://github.com/introlab/rtabmap_ros

Follow installation instructions "from source" at the bottom of the rtabmap_ros page. Documentation about the ROS package can be found on the ROS wiki.
Reply | Threaded
Open this post in threaded view
|

Re: Build octomap with rtabmap?

Sovik Chowhdury
In reply to this post by matlabbe
I am trying to do the same with R200 realsense, RTAB and octomap. And implement it on my quadcopter for object avoidance.
I am really new to ROS. Although I have installed rtabmap_ros , rtabmap, octomap_mapping/octomap_server (and catkin_make it).

I was able to implement RTAB with r200 realsense but want to implement the same with octomap. Please share your insights on the matter on how to run the nodes to achieve the octomap real time.

I'll really appreciate it. Thank you very much.
Reply | Threaded
Open this post in threaded view
|

Re: Build octomap with rtabmap?

matlabbe
Administrator
Hi,

From mid 2016 I think, rtabmap publishes directly an octomap for convenience. See /rtabmap/octomap_binary or /rtabmap/octomap_full output topics. The advantage to use octomap output from rtabmap is that on loop closure, the octomap is corrected efficiently.

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

Re: Build octomap with rtabmap?

alexr
This post was updated on .
Hi Mathieu,

How to call the /rtabmap/octomap_binary and /rtabmap/octomap_full topics from the rviz when running rtabmap?
I am running the bag file with the demo_robot_mapping.launch file. Do I need to run the octomap_server octomap_mapping.launch file as well to see the octomap being build instead of the mapcloud?

Also how to save the octomap from the rtabmap? octomap_server octomap_saver doesn't seem to work with rtabmap!

------ Alex
Reply | Threaded
Open this post in threaded view
|

Re: Build octomap with rtabmap?

Sovik Chowhdury
I have been trying to achieve the above created octomap with IROS14-kinect-challenge.db dataset. I have followed exactly the command mentioned above. Also tried to change database path in rtabmap.launch. But everytime RTABMAP throws error:

[ WARN] [1487764930.631162656]: /rtabmap/rtabmap: Did not receive data since 5 seconds! Make sure the input topics are published ("$ rostopic hz my_topic") and the timestamps in their header are set. If topics are coming from different computers, make sure the clocks of the computers are synchronized ("ntpdate"). If topics are not published at the same rate, you could increase "queue_size" parameter (current=10).
/rtabmap/rtabmap subscribed to (approx sync):
   /rtabmap/odom,
   /camera/rgb/image_rect_color,
   /camera/depth_registered/image_raw,
   /camera/rgb/camera_info


 Also tried to on the dataset "Stereo_20Hz.db" and followed the instructions mentioned on " https://github.com/introlab/rtabmap/wiki/Stereo-mapping " (Process a directory of stereo images in ROS). throws error with no visualization in either Rviz and Rtabmapviz:

[ WARN] [1487765471.718534328]: odometry: Could not get transform from base_link to stereo_20Hz_left (stamp=1487765471.498146) after 0.200000 seconds ("wait_for_transform_duration"=0.200000)! Error=". canTransform returned after 0.201731 timeout was 0.2."

Can anyone kindly help me out with this?
Reply | Threaded
Open this post in threaded view
|

Re: Build octomap with rtabmap?

matlabbe
Administrator
Hi,

To make demo_robot_mapping.launch creating an octomap, we should set Grid/FromDepth to true here, otherwise you will have warning messages like that:
[ WARN] [1487979378.049216509, 1368730029.272126723]: Node -1: Cannot update octomap with 2D occupancy grids. Do "$ rosrun rtabmap_ros rtabmap --params | grep Grid" to see all occupancy grid parameters.
[ WARN] [1487979378.049270915, 1368730029.272126723]: Node 1: Cannot update octomap with 2D occupancy grids. Do "$ rosrun rtabmap_ros rtabmap --params | grep Grid" to see all occupancy grid parameters.
[ WARN] [1487979378.049311562, 1368730029.272126723]: Node 3: Cannot update octomap with 2D occupancy grids. Do "$ rosrun rtabmap_ros rtabmap --params | grep Grid" to see all occupancy grid parameters.
...

$ roslaunch rtabmap_ros demo_robot_mapping.launch rviz:=true rtabmapviz:=false
$ rosbag play --clock demo_mapping.bag



For stereo 20 Hz tutorial, I updated the stereo_20Hz.launch to fix the TF issue and added option "ground_is_obstacle" so that octomap is also built with the ground:
$ roslaunch stereo_20Hz.launch ground_is_obstacle:=true


Note that these tests were done on Ubuntu 16.04/Kinetic.

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

Re: Build octomap with rtabmap?

sean819
In reply to this post by matlabbe
Hi,
I follow this instruction. But I just have this point cloud map.
Does anyone know how can I open colored octomap and colored point cloud map?
Reply | Threaded
Open this post in threaded view
|

Re: Build octomap with rtabmap?

sean819
Let me reply my question.
Because I use VMware. And there are some problem of VM's 3D acceleration.
After i turn off 3D acceleration, it works.