ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

For mapping, what should i do after connecting to the laser?

asked 2016-05-04 10:50:22 -0500

bsk gravatar image

updated 2016-05-06 06:59:08 -0500

Hi everyone!

It's my first question and i'm so new to ROS (and even Linux :/ ) Anyway i tried to create a map with laser scanner, Sick LMS100. I installed lms1xx drivers, and i wrote the code "rosrun lms1xx LMS1xx_node" then it said It connected to laser...So connection is ok but I dont know what to do next? What are my options for creating a simple map or something like floor plan?

By the way, right now i dont have a robot, just the laser scanner.


edit retag flag offensive close merge delete


You should probably start with a simpler topic. Mapping is a rather advanced task in robotics and not the first thing you should try if you have never ROS or Linux. Have you already done the tutorials?

NEngelhard gravatar image NEngelhard  ( 2016-05-04 11:13:53 -0500 )edit

I'm doing the tutorials as well, but i have to do something like basic mapping, floor plan etc as soon as possible :/

bsk gravatar image bsk  ( 2016-05-04 12:04:56 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-05-07 06:21:50 -0500

hashim gravatar image

updated 2016-05-11 10:29:55 -0500

go for hector_slam if you want to create a floor plan of the environment. First you need to make sure that your laser data is publishing on a /scan topic and then run hector_mapping node available in hector_slam package

if you browse through hector_slam_launch/launch files you will find tutorial launch file. this is the file you need to launch. next you have to edit your mapping_default.launch and tutorial.launch.

In tutorial.launch file, add these lines at the end

<node pkg="tf" type="static_transform_publisher" name="map_baselink_broadcaster" args="0 0 0 0 0 0 map base_link 100"/>

<node pkg="tf" type="static_transform_publisher" name="baselink_laser_broadcaster" args="0 0 0 0 0 0 base_link laser 100"/>

and also set use_sim_time to 'false'

In mapping_default file, use following configuration

"map_frame" value="map" />

"base_frame" value="base_link" />

"odom_frame" value="base_link" />

hope this solves your query

edit flag offensive delete link more


I connected with laser and checked by rostopic echo /scan and its ok. in another terminal i wrote roslaunch hector_mapping mapping_default.launch. Am i doing right? It says in INFO: lookupTransform base_footprint to laser timed out. Could not transform laser scan into base_frame.

bsk gravatar image bsk  ( 2016-05-11 07:40:45 -0500 )edit

Don't use a static transform from map to base_link, the node provides that. If you do that it will only map based on the first scan. The map only updates after a certain amount of translation or rotation occurs. If you have a static transform the node will never know when the sensor's moved.

Icehawk101 gravatar image Icehawk101  ( 2016-05-11 15:02:36 -0500 )edit

@hashim I tried(finally i managed to create overlay_ws and can able to modify hector_slam) when i modified like you wrote and run hector_slam_launch tutorial.launch It didnt gave error. Thank you soooo much.

bsk gravatar image bsk  ( 2016-05-18 06:25:40 -0500 )edit

welcome... kindly mark it as an answer :)

hashim gravatar image hashim  ( 2016-05-18 06:52:29 -0500 )edit

@hashim by the way the map in the rviz is a bit strange. when i move or turn laser around it become a mess. It is like that.

bsk gravatar image bsk  ( 2016-05-18 07:27:39 -0500 )edit

Do not yaw too much for getting the accurate map. Basically it depends on the frequency and range of the laser scanner you are using. Hector_slam is build for scanners of 25-30hz. Otherwise keep you scanner level with ground and avoid abrupt movements and yawing

hashim gravatar image hashim  ( 2016-05-18 07:40:52 -0500 )edit

Something is wrong. I've used hector_mapping with an LMS100 and had no problem with yaw. How fast are you rotating?

Icehawk101 gravatar image Icehawk101  ( 2016-05-18 07:52:21 -0500 )edit

I have LMS100 too. Frequency was 50 hz so i changed it to 25 Hz(in its own program SOPAS) but now when i try to connect it gives error like "Unable to get laser output range"

bsk gravatar image bsk  ( 2016-05-18 09:55:33 -0500 )edit

Question Tools


Asked: 2016-05-04 10:13:47 -0500

Seen: 850 times

Last updated: May 11 '16