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
http://wiki.ros.org/hector_slam
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
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
Originally posted by hashim with karma: 53 on 2016-05-07
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by bsk on 2016-05-11:
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.
Comment by Icehawk101 on 2016-05-11:
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.
Comment by bsk on 2016-05-18:
@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.
Comment by hashim on 2016-05-18:
welcome... kindly mark it as an answer :)
Comment by bsk on 2016-05-18:
@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. http://tinypic.com/r/117zmsn/9
Comment by hashim on 2016-05-18:
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
Comment by Icehawk101 on 2016-05-18:
Something is wrong. I've used hector_mapping with an LMS100 and had no problem with yaw. How fast are you rotating?
Comment by bsk on 2016-05-18:
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"
Comment by hashim on 2016-05-18:
no keep it to 50hz. then... its more than enough
Comment by hashim on 2016-05-18:
share you tutorial.launch and mapping_default.launch files
Comment by bsk on 2016-05-18:
I cut the power of laser scanner and gave it again :) and now it connected with 25 Hz. i rotate and move it more slowly an results is like http://tinypic.com/r/2dipwmb/9 It looks better than the first
Comment by hashim on 2016-05-18:
better results