introlab / rtabmap_ros

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

rtabmap create map not properly #1166

Open PHChenGit opened 5 months ago

PHChenGit commented 5 months ago

Problem Description: When using rtabmap for mapping, the map produced greatly differs from the map in Gazebo. Environment: ROS Noetic Model: PX4 iris_with_depth_camera Purpose: I hope to perform vSLAM.

What I did? I used the keyboard to control the drone to fly around the map in Gazebo. Then, I used the command rosrun map_server map_saver -f warehouse_map_4.yaml map:=/rtabmap/octomap_grid to save the map that was created.

I have tried several times. The maps created by rtabmap are always like this.

rtabmap_map gazebo_map

Here is my rtabmap_mapping.launch file

<?xml version="1.0" encoding="UTF-8"?>

<launch>
  <arg name="rgb_topic"   default="/iris/camera/rgb/image_raw"/>
  <arg name="depth_topic" default="/iris/camera/depth/image_raw"/>
  <arg name="camera_info_topic" default="/iris/camera/rgb/camera_info"/>

  <include file="$(find rtabmap_ros)/launch/rtabmap.launch">           
    <arg name="args"       value="--delete_db_on_start --RGBD/OptimizeMaxError 0.1 "/>
    <arg name="depth_topic"        value="$(arg depth_topic)"/>
    <arg name="visual_odometry"    value="true"/>
    <arg name="rgb_topic"          value="$(arg rgb_topic)"/>
    <arg name="camera_info_topic"  value="$(arg camera_info_topic)"/>
    <arg name="frame_id"           value="camera_link"/>

    <arg name="rviz"               value="false"/>
    <arg name="rtabmapviz"         value="true"/>
  </include>  

</launch>
matlabbe commented 5 months ago

Can you share the resulting database?

There could be a problem with sensor frames, or wrong frame_id actually set in the image topic.