rtabmap create map not properly
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.
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>
Can you share the resulting database?
There could be a problem with sensor frames, or wrong frame_id actually set in the image topic.