OccupancyGrid.cpp:380::createLocalMap() Cannot create local map, scan is empty (node=326, Grid/Sensor=0).
Hello everyone. I am working on a pepper robot with rtabmap. the robot as a Xtion 3D camera. RGB cameras and a laser. I want to use all these three for generating map. this is my launch file.
<?xml version="1.0" encoding="UTF-8"?>
<launch>
<arg name="database_path" default="$(find my_robot)/launch/rtabmap.db"/>
<arg name="rgb_topic" default="/pepper_robot/camera/front/image_raw"/>
<arg name="depth_topic" default="/pepper_robot/camera/depth/image_raw"/>
<arg name="camera_info_topic" default="/pepper_robot/camera/front/camera_info"/>
<arg name="scan" default="/pepper_robot/laser"/>
<group ns="rtabmap">
<node pkg="nodelet" type="nodelet" name="rgbd_sync" args="standalone rtabmap_ros/rgbd_sync" output="screen">
<!-- RTAB-Map Inputs -->
<remap from="scan" to="$(arg scan)"/>
<remap from="rgb/image" to="$(arg rgb_topic)"/>
<remap from="rgb/camera_info" to="$(arg camera_info_topic)"/>
<remap from="depth/image" to="$(arg depth_topic)"/>
<remap from="rgbd_image" to="rgbd_image"/>
<remap from="odom" to="/pepper_robot/odom"/>
<!-- Should be true for not synchronized camera topics
(e.g., false for kinectv2, zed, realsense, true for xtion, kinect360)-->
<param name="approx_sync" value="true"/>
</node>
<node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">
<!-- RTAB-Map Inputs -->
<remap from="scan" to="$(arg scan)"/>
<remap from="rgb/image" to="$(arg rgb_topic)"/>
<remap from="depth/image" to="$(arg depth_topic)"/>
<remap from="rgb/camera_info" to="$(arg camera_info_topic)"/>
<remap from="odom" to="/pepper_robot/odom"/>
<!-- Basic RTAB-Map Parameters -->
<param name="database_path" type="string" value="$(arg database_path)"/>
<param name="frame_id" type="string" value="base_link"/>
<param name="odom_frame_id" type="string" value="odom"/>
<param name="subscribe_depth" type="bool" value="false"/>
<param name="subscribe_scan" type="bool" value="false"/>
<param name="RGBD/AngularUpdate" type="string" value="0.05"/>
<param name="RGBD/LinearUpdate" type="string" value="0.05"/>
<param name="RGBD/OptimizeFromGraphEnd" type="string" value="false"/>
<!-- <remap from="odom" to="/pepper_robot/odom"/> -->
<param name="Rtabmap/ImagesAlreadyRectified" value="true" />
<param name="queue_size" type="int" value="10"/>
<!-- RTAB-Map Output -->
<remap from="/rtabmap/grid_proj_map" to="/map"/>
<!-- RTAB-Map Output -->
<remap from="/rtabmap/grid_proj_map" to="/map"/>
<!-- Rate (Hz) at which new nodes are added to map -->
<param name="Rtabmap/DetectionRate" type="string" value="1"/>
<!-- 2D SLAM -->
<param name="Reg/Force3DoF" type="string" value="true"/>
<!-- <param name="Reg/Force3DoF" type="string" value="true"/>-->
<!-- Loop Closure Detection -->
<!-- 0=SURF 1=SIFT 2=ORB 3=FAST/FREAK 4=FAST/BRIEF 5=GFTT/FREAK 6=GFTT/BRIEF 7=BRISK 8=GFTT/ORB 9=KAZE -->
<param name="Kp/DetectorStrategy" type="string" value="0"/>
<param name="Vis/FeatureType" type="string" value="0"/>
<!-- Maximum visual words per image (bag-of-words) -->
<param name="Kp/MaxFeatures" type="string" value="400"/>
<!-- Used to extract more or less SURF features -->
<param name="SURF/HessianThreshold" type="string" value="100"/>
<!-- Loop Closure Constraint -->
<!-- 0=Visual ...
Is this error happens often? It seems rtabmap received an invalid or empty (with only NaNs) laser scan topic.
Thanks for the response matlabbe. yes,it happens often as you can see here. and even in rviz it shows only numbers but no exact map. I don't know where I am doing mistakes.
You could share the database if you want. I only see the depth/right warnings in the log. they seem appearing 90 sec after start. You may close rtabmapviz to see if those warnings are coming from rtabmap node or rtabmapviz node.
Note also you are not subscribing to any laser scan for rtabmap node, so if you
Grid/Sensor=0
, it is likely that it will warn that you don't have any lidar data. Looking at the log, rtabmap node subscribing to:As you are using rgbd_sync, set
subscribe_rgbd=true
, also setsubscribe_scan=true
. See also this configuration similar to yours: http://wiki.ros.org/rtabmap_ros/Tutor...