=====SLAM: Self Localization and Mapping ===== **Prerequisite:** * get a running catkin environment. * check your environment variables. * check the necessary topics are up and running (''cmd_vel'', ''laser'', ''tf'',...) * [[ROSLaserFilter|Filter]] the LaserScan if necessary. * Run: roscore and robot drivers and scripts. ---- ==== gmapping ==== Even without having a map of the environment, we can create one on-the-fly, thanks to [[http://wiki.ros.org/slam_gmapping/Tutorials|SLAM]] (Self Localization and Mapping). You will need to set up you robot completely, then to launch ''slam_gmapping''. It may be helpful to create a launchfile to pass parameters, for example in ''gmapping.launch'': ''\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ '' Then, launch ''rviz'' and see the result, published in topic ''/map''. ---- ==== Hector Slam==== * This [[http://wiki.ros.org/hector_slam|metapackage]] is part of the [[http://wiki.ros.org/tu-darmstadt-ros-pkg|TU Darmstadt]] repository. * To install it in Debian/Ubuntu: ''sudo apt-get install ros-hydro-hector-slam'' * For mapping, we're intested in the [[http://wiki.ros.org/hector_mapping|hector_mapping]] package. ---- ====Working offline with a "bag" of data==== One may need to first record the data before computing the map. That is possible, with a "bag". See the tutorial [[http://wiki.ros.org/slam_gmapping/Tutorials/MappingFromLoggedData]] One first needs to make a bag of data, e.g.: ''rosbag record -O mylaserdata /scan /tf''