Posted by
matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Navigation-Stack-rtabmap-requesting-map-configuration-problem-tp1378p1488.html
Can you track if the error is coming from the inflation layer of the local costmap or the global costmap?
The global costmap is created from /map (which is a remap from /rtabmap/proj_map?) and the obstacle_layer.
The local costmap is created from the obstacle_layer.
The obstacle_layer
should not be /rtabmap/cloud_map topic. It should be the sensor data. I assume that you are using a Kinect-like sensor, I use this for an obstacle_layer:
obstacle_layer:
obstacle_range: 2.5
raytrace_range: 3
max_obstacle_height: 0.4
track_unknown_space: true
observation_sources: point_cloud_sensorA point_cloud_sensorB
point_cloud_sensorA: {
sensor_frame: base_link,
data_type: PointCloud2,
topic: /obstacles_cloud,
expected_update_rate: 0.5,
marking: true,
clearing: true,
min_obstacle_height: 0.04
}
point_cloud_sensorB: {
sensor_frame: base_link,
data_type: PointCloud2,
topic: /ground_cloud,
expected_update_rate: 0.5,
marking: false,
clearing: true,
min_obstacle_height: -1.0 # make sure the ground is not filtered
}
With this in the launch file (note that openni or freenect's camera_nodelet_manager is used for efficiency):
<!-- Throttling messages -->
<group ns="camera">
<node pkg="nodelet" type="nodelet" name="data_throttle" args="load rtabmap_ros/data_throttle camera_nodelet_manager">
<param name="rate" type="double" value="5"/>
<param name="decimation" type="int" value="2"/>
<remap from="rgb/image_in" to="rgb/image_rect_color"/>
<remap from="depth/image_in" to="depth_registered/image_raw"/>
<remap from="rgb/camera_info_in" to="depth_registered/camera_info"/>
<remap from="rgb/image_out" to="data_resized_image"/>
<remap from="depth/image_out" to="data_resized_image_depth"/>
<remap from="rgb/camera_info_out" to="data_resized_camera_info"/>
</node>
<!-- for the planner -->
<node pkg="nodelet" type="nodelet" name="points_xyz_planner" args="load rtabmap_ros/point_cloud_xyz camera_nodelet_manager">
<remap from="depth/image" to="data_resized_image_depth"/>
<remap from="depth/camera_info" to="data_resized_camera_info"/>
<remap from="cloud" to="cloudXYZ" />
<param name="decimation" type="int" value="1"/> <!-- already decimated above -->
<param name="max_depth" type="double" value="3.0"/>
<param name="voxel_size" type="double" value="0.02"/>
</node>
<node pkg="nodelet" type="nodelet" name="obstacles_detection" args="load rtabmap_ros/obstacles_detection camera_nodelet_manager">
<remap from="cloud" to="cloudXYZ"/>
<remap from="obstacles" to="/obstacles_cloud"/>
<remap from="ground" to="/ground_cloud"/>
<param name="frame_id" type="string" value="base_link"/>
<param name="map_frame_id" type="string" value="map"/>
<param name="wait_for_transform" type="bool" value="true"/>
<param name="min_cluster_size" type="int" value="20"/>
<param name="max_obstacles_height" type="double" value="0.4"/>
</node>
</group>
Note also to simplify your launch file, you can create a new one and include
rtabmap.launch unless there are ROS parameters you want to change not available as arguments of rtabmap.launch:
<launch>
<include file="$(find rtabmap_ros)/launch/rtabmap.launch">
<arg name="frame_id" value="base_link"/>
<arg name="rtabmap_args" value="--delete_db_on_start --Reg/Force3DoF true --Optimizer/Slam2D true --DbSqlite3/InMemory true "/>
... (other arguments from rtabmap.launch)
</include>
</launch>
For "Rtabmap/DetectionRate" parameter, I don't recommend increasing it over 1 Hz as the map size and loop closure detection computation time will increase faster. Increasing the rate would be in cases where there are holes between consecutive point clouds because the robot would move very fast.
cheers