laserscanner sick s300 showing no map on rviz only laser scan

asked 2017-08-18 13:56:39 -0600

sultan.shahrukh gravatar image

Hi friends, I am relatively new to ROS and trying to get to know it. I have a sick s300 laser distance sensor, I want to generate a 2D map using hector slam. So far I have the rviz in operation showing only the laserscan but not generating any map at all. I have been searching in the community and elsewhere for quite a bit and can't figure out. Any help would be really appreciated .

Here are my files below ( these files were available in the tutorial hector slam but are a bit modified by me), I have also included the mapping bag file from hector_slam tutorial in my launch file:

1 ) s300_config1.yaml

port: /dev/ttyUSB0 baud: 500000 scan_duration: 0.025 scan_cycle_time: 0.0400 scan_id: 7 frame_id: /base_laser_link scan_intervals: [[-1.3526, 1.361357]] fields: '1': scale: 0.01 start_angle: -2.355 stop_angle: 2.355

2) s300_launch.launch


<!-- start laser driver -->
<node name="laser" pkg="cob_sick_s300" type="cob_sick_s300" respawn="false" output="screen">
    <rosparam command="load" file="s300_config1.yaml"/>



3) hector_map.launch


<node pkg="rviz" type="rviz" name="rviz" args="-d /home/sultan/workspace/LaunchFiles/rviz_cfg.rviz"/>

<arg name="geotiff_map_file_path" default="/home/sultan/workspace/buildingmap/Team_Hector_MappingBox_L101_Building.bag.1"/> <node name="static_tf0" pkg="tf" type="static_transform_publisher" args="1 0 0 0 0 0 /world/map 100"/>

<node pkg="tf" type="static_transform_publisher" name="map_to_scanmatcher" args="0 0 0 0 0 0 /map /hector_mapping 100"/> <node pkg="tf" type="static_transform_publisher" name="map_to_base_footprint" args="0 0 0 0 0 0 /map /base_footprint 100"/> <node pkg="tf" type="static_transform_publisher" name="base_footprint_to_base_link" args="0 0 0 0 0 0 /base_footprint /base_link 100"/> <node pkg="tf" type="static_transform_publisher" name="base_link_to_base_stabilized" args="0 0 0 0 0 0 /base_link /base_stabilized 100"/> <node pkg="tf" type="static_transform_publisher" name="base_stablized_to_base_frame" args="0 0 0 0 0 0 /base_stabilized /base_frame 100"/> <node pkg="tf" type="static_transform_publisher" name="base_frame_to_laser_link" args="0 0 0 0 0 0 /base_frame /camera_link 100"/> <node pkg="tf" type="static_transform_publisher" name="base_to_nav_link" args="0 0 0 0 0 0 /base_frame /nav 100"/>

<arg name="tf_map_scanmatch_transform_frame_name" default="scanmatcher_frame"/> <arg name="base_frame" default="base_footprint"/>

<arg name="odom_frame" default="nav"/> <arg name="pub_map_odom_transform" default="true"/> <arg name="scan_subscriber_queue_size" default="5"/> <arg name="scan_topic" default="laser/scan"/> <arg name="map_size" default="2048"/>

<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">

<!-- Frame names -->
<param name="map_frame" value="map" />
<param name="base_frame" value="$(arg base_frame)" />
<param name="odom_frame" value="$(arg odom_frame)" />

<!-- Tf use -->
<param name="use_tf_scan_transformation" value="true"/>
<param name="use_tf_pose_start_estimate" value="false"/>
<param name="pub_map_odom_transform" value="$(arg pub_map_odom_transform)"/>

<!-- Map size / start point -->
<param name="map_resolution" value="0.050"/>
<param name="map_size" value="$(arg map_size)"/>
<param name="map_start_x" value="0.5"/>
<param name="map_start_y" value="0.5" />
<param name="map_multi_res_levels" value="2" />

<!-- Map update parameters -->
<param name="update_factor_free" value="0.4"/>
<param name="update_factor_occupied" value="0.9" />    
<param name="map_update_distance_thresh" value="0.4"/>
<param name="map_update_angle_thresh" value="0.06" />
<param name="laser_z_min_value" value = "-1.0" />
<param name="laser_z_max_value" value = "1.0" />

<!-- Advertising config --> 
<param name="advertise_map_service" value="true"/>

<param ...
edit retag flag offensive close merge delete


Have you included the map in RVIZ? If not already there, you need to add a 'map' visualization and connect it to the '/map' topic.

billy gravatar image billy  ( 2017-08-20 12:16:00 -0600 )edit

Thank you for your reply. Yes, I have already tried doing that but it makes no difference. Any other recommendations?

sultan.shahrukh gravatar image sultan.shahrukh  ( 2017-08-21 06:59:11 -0600 )edit

Are you getting any indicators some thing is wrong, like "Dropped 100.00% of messages so far"?

Have you tried your setup with a bag file yet? You may want to try that to verify everything on ROS side is working.

When I used Hector, I found I need the robot to move and turn VERY slowly to work.

billy gravatar image billy  ( 2017-08-21 12:33:48 -0600 )edit