Skip to content
This repository has been archived by the owner on Aug 2, 2019. It is now read-only.

Hector SLAM

tanyax edited this page Jun 20, 2017 · 10 revisions

Follow steps for setting up LIDAR usage.

  1. roscore
  2. rosrun urg_node urg_node _ip_address:=192.168.1.11
  3. [Create bridge] sudo brctl addbr br0 sudo brctl addif br0 eth1[LIDAR first] sudo brctl addif br0 eth0[pico] sudo ifconfig br0 192.168.1.2 [anything that isn't being used] netmask 255.255.255.0 up (this step is necessary if need to access picostation)
  4. roslaunch hector_slam_launch tutorial.launch
  5. Move car around and perform mapping until satisfactory. cd [directory to save to] rosrun map_server map_saver -f [name of file]
  6. Close hector slam. In order to publish to /map topic now: cd [map directory] rosrun map_server map_server [yaml file name i.e. test.yaml]

The following steps should be taken instead if we also want to store a rosbag copy of the map.

  1. If using rosbag: rosbag record -O [name of file] [topic name i.e. \map]
  2. Close/quit rosbag record and close hector slam. Play rosbag: rosbag play [bag file name i.e. testmap.bag]
  3. cd [map directory] rosrun map_server map_server [yaml file name i.e. test.yaml]

map_server: takes map topic and save snapshots of these messages; primary use here is to be able to broadcast a saved map to other mapping algorithms.


While we use certain ROS packages out-of-the-box (e.g. hector_slam), the following are modifications made to these third-party ROS packages:

  • hector_slam_launch/launch/tutorial.launch: set sim time in ROS (realtime=false vs bag=true), transforms (make sure names are correct as used in hector_mapping)

  • hector_mapping/launch/mapping_default.launch: parameters (mainly "Frame names"; (scan would change if lidar publishes to different name topic) ) must match previous launch file; can change default resolution/size of map here as well.

Custom ROS packages are (should be) saved in ~/catkin_ws, whereas third-party packages are default installed into {CHECK PATH}