RTAB-Map doesn't create map
Hi, I have setup like this : robot with 3D Lidar (Livox Mid 70) and Realsense D435 camera. I want to use RTAB-Map to build map of indoor environment. First I wanted to do combine data from lidar and camera but I can't get it to generate the map, without this static_transform_publisher, there no map frame in tf tree and when I try to run rostpic echo /mapData for example, nothing is being published. What am I doing wrong? Here is my launch file and rviz visualisation of that.
<!-- -->
<launch>
<param name="robot_description" textfile="$(find bbot_description)/urdf/bbot.urdf" />
<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
<param name="publish_frequency" type="double" value="10.0" />
<param name="rate" value="10.0"/>
</node>
<node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher">
<param name="use_gui" value="false"/>
<param name="rate" value="10.0"/>
</node>
<node pkg="tf" type="static_transform_publisher" name="odom2map" args="0 0 0 0 0 0 map odom 10" />
<arg name="depth" default="true"/>
<arg name="rviz" default="true" />
<arg name="localization" default="false"/>
<param name="use_sim_time" type="bool" value="true"/>
<arg name="cfg" default="" />
<arg name="gui_cfg" default="~/.ros/rtabmap_gui.ini" />
<arg name="rviz_cfg" default="$(find rtabmap_ros)/launch/config/rgbd.rviz" />
<arg name="frame_id" default="base_link"/>
<arg name="odom_frame_id" default="odom"/>
<arg name="map_frame_id" default="map"/>
<arg name="namespace" default="rtabmap"/>
<arg name="database_path" default="~/.ros/rtabmap.db"/>
<arg name="queue_size" default="100"/>
<arg name="wait_for_transform" default="0.2"/>
<arg name="output" default="screen"/>
<arg name="publish_tf_map" default="true"/>
<arg name="approx_sync" default="false"/>
<!-- RGB-D related topics -->
<arg name="rgb_topic" default="/realsense_left/color/image_raw" />
<arg name="depth_topic" default="/realsense_left/aligned_depth_to_color/image_raw" />
<arg name="camera_info_topic" default="/realsense_left/color/camera_info" />
<arg name="depth_camera_info_topic" default="/realsense_left/aligned_depth_to_color/camera_info" />
<arg name="subscribe_rgb" default="false"/>
<arg name="subscribe_depth" default="false"/>
<!-- Already synchronized RGB-D related topic, with rtabmap_ros/rgbd_sync nodelet -->
<arg name="rgbd_sync" default="true"/>
<arg name="approx_rgbd_sync" default="false"/>
<arg name="subscribe_rgbd" default="true"/>
<arg name="rgbd_topic" default="rgbd_image" />
<arg name="depth_scale" default="1.0" />
<arg name="rgbd_depth_scale" default="$(arg depth_scale)" />
<arg name="rgbd_decimation" default="1" />
<arg name="compressed" default="false"/>
<arg name="rgb_image_transport" default="compressed"/>
<arg name="depth_image_transport" default="compressedDepth"/>
<arg name="subscribe_scan" default="false"/>
<arg name="scan_topic" default="/scan"/>
<arg name="subscribe_scan_cloud" default="true"/>
<arg name="scan_cloud_topic" default="/scan_cloud"/>
<arg name="subscribe_scan_descriptor" default="false"/>
<arg name="scan_descriptor_topic" default="/scan_descriptor"/>
<arg name="scan_cloud_max_points" default="0"/>
<arg name="scan_cloud_filtered" default="false"/>
<arg name="visual_odometry" default="true"/>
<arg name="icp_odometry" default="false"/>
<arg name="odom_topic" default="odom"/>
<arg name="vo_frame_id" default="$(arg odom_topic)"/>
<arg name="publish_tf_odom" default="true"/>
<arg name="odom_tf_angular_variance" default="0.001"/>
<arg name="odom_tf_linear_variance" default="0.001"/>
<arg name="odom_args ...
Are there warnings in terminal? If
/map
frame is not published, it means rtabmap is not able to synchronize input data.approx_sync
should be true in your case.If
visual_odomerty
is true andicp_odometry
is false I get these warnings.If
visual_odometry
is set to false, andicp_odometry
to true, I get this :Which one should I use and which params to set if i want to for example use camera and lidar for depth. I also have wheel odometry topic in that .bag file if I can use it.
To simplify, start with wheel odometry. Set
visual_odometry
andicp_odometry
to false, and setodom_topic
argument to your wheel odometry topic.For info:
rgbd_sync
is enabled, the warning tells thatrgbd_image
is not published, verify inputs of rgbd_sync node:rostopic hz /realsense_left/color/image_raw /realsense_left/aligned_depth_to_color/image_raw /realsense_left/color/camera_info
).