introlab / rtabmap_ros

RTAB-Map's ROS package.
http://wiki.ros.org/rtabmap_ros
BSD 3-Clause "New" or "Revised" License
957 stars 557 forks source link

depth camera and laser grid map #845

Open davidlmljll opened 1 year ago

davidlmljll commented 1 year ago

Hi When using the depth camera and 2D laser to build a 2D grid map, some of the environmental information detected by the depth camera does not appear on the final grid map(the camera is mounted at a lower height than the laser) depth camera grid map:

camera laser grid map: laser laser + depth camera map: camera_laser

matlabbe commented 1 year ago

Can I assume you set Grid/Sensor=2? If Grid/3D is false, the lidar may ray trace the cells from the camera. To help more, I would need the database.

davidlmljll commented 1 year ago

Thank you very much for your reply! I re-checked the parameter settings and found that it was because I did not enable octomap library support. By default, General\Octomap = false. When I changed General\Octomap = true, 3D ray trace seemed to be correct and 2D grid maps are fine in the rtabmap interface, but with rtabMap-databaseViewer some of the depth image occupancy grids will disappear. rtabmap interface: 捕获 rtabmap-databaseViewer interface: 捕获1

matlabbe commented 1 year ago

You can inspect local occupancy grid for each node in DatabaseViewer with 3D View, then click on Grid checkbox.

davidlmljll commented 1 year ago

Thank you very much for your reply, I see the result I want in the rtabmap-databaseViewer interface!

davidlmljll commented 1 year ago

I am very sorry, I recently loaded the previous db file with code and found that the grid map data still did not include the depth camera recorded data, but in rtabmap-databaseViewer when I opened octomap, the grid map will show the depth camera recorded data, specifically as follows: rtabmap-databaseViewer: rtabmap-database_with_octomap rviz(load db file): Screenshot from 2022-12-13 10-02-33

matlabbe commented 1 year ago

If you are loading the map in localization mode, the map in rviz is the optimized occupancy grid. You can compare the optimized one and the one created in GraphView in rtabmap-databaseViewer. For the optimized one, do File->Edit optimized 2d map.... Are both maps not identical?

davidlmljll commented 1 year ago

Thank you very much for your reply,I opened the optimized map option in rtabmap-databaseViewer, which is the same as the map shown in rviz!This confused me. The obstacle data generated by the depth camera in the actual scene was real, but it disappeared after optimizing the map. How can I optimize the map correctly? rtabmap-databaseViewer(the optimized occupancy grid): 捕获

matlabbe commented 1 year ago

You would have to open the 3D View in database viewer, click on Grid checkbox and debug your local occupancy grids to see if the obstacle was really detected as obstacle, and if next nodes are ray tracing over it. You can also open Occupancy grid view. Play with number keys 1->5 on the keyboard in those views to change the colors to better see the obstacles.