1、Hand-held radar mapping1.1、Mapping1.1.1、gmapping1.1.2、hector1.1.3、karto1.1.4、cartographer1.2、Save map1.3、View related information
Gmapping:http://wiki.ros.org/gmapping/
hector_slam:http://wiki.ros.org/hector_slam
hector_slam/Tutorials:http://wiki.ros.org/hector_slam/Tutorials/SettingUpForYourRobot
hector_mapping:http://wiki.ros.org/hector_mapping
karto:http://wiki.ros.org/slam_karto
Cartographer:https://google-cartographer.readthedocs.io/en/latest/
Cartographer ROS:https://google-cartographer-ros.readthedocs.io/en/latest/
rrt_exploration:http://wiki.ros.org/rrt_exploration
rrt_exploration/Tutorials:http://wiki.ros.org/rrt_exploration/Tutorials
map_server:https://wiki.ros.org/map_server
Install dependent libraries
sudo apt install ros-melodic-moveit ros-melodic-moveit-visual-tools ros-melodic-kdl-* ros-melodic-joint-state-publisher-gui ros-melodic-trac-ik liborocos-kdl-dev ros-melodic-teleop-twist-keyboard ros-melodic-moveit-resources ros-melodic-navigation ros-melodic-gmapping ros-melodic-hector-slam ros-melodic-slam-karto ros-melodic-robot-state-publisher ros-melodic-geographic-msgs ros-melodic-libuvc-* ros-melodic-rtabmap-ros libavformat-dev libavcodec-dev libswresample-dev libswscale-dev libavutil-dev libsdl1.2-dev ros-melodic-libuv ros-melodic-pointcloud-to-laserscan ros-melodic-mbf-msgs ros-melodic-mbf-costmap-core ros-melodic-costmap-converter ros-melodic-bfl ros-melodic-serial ros-melodic-teleop-twist-joy ros-melodic-laser-proc ros-melodic-rosserial-arduino ros-melodic-rosserial-python ros-melodic-rosserial-server ros-melodic-rosserial-client ros-melodic-rosserial-msgs ros-melodic-amcl ros-melodic-map-server ros-melodic-urdf ros-melodic-xacro ros-melodic-interactive-markers ros-melodic-octomap* ros-melodic-joy* ros-melodic-dwa-local-planner ros-melodic-multirobot-map-merge python-catkin-tools python3-dev python3-catkin-pkg-modules python3-numpy python3-yaml build-essential ros-melodic-imu-tools ros-melodic-cartographer*
If it is a new environment, you need to copy the lua file and launch file of cartographer to the corresponding location
xxxxxxxxxx
cd ~/rplidar_ws/src/transbot_nav/scripts/
sudo bash create.sh
Build map start command
xxxxxxxxxx
roslaunch transbot_nav laser_map.launch lidar_type:=a1 map_type:=gmapping robot_model:=astra
lidar_type parameter: the type of lidar used: [a1, a2, a3, s1, s2], the default is [a1].
map_type parameter: mapping algorithm [gmapping, hector, karto, cartographer], the default is [gmapping].
robot_model parameters: simulation model [astra, camera].
When creating a map in rviz, if [LaserScan] reports an error and fails to load the lidar data; select it, click [Remove] to remove it, and click [Add] to add it again. Just select the corresponding topic.
Several mapping algorithms save maps in different ways.
xxxxxxxxxx
bash ~/rplidar_ws/src/transbot_nav/maps/carto_map.sh
xxxxxxxxxx
rosrun map_server map_saver -f ~/rplidar_ws/src/transbot_nav/maps/my_map # Method 1
bash ~/rplidar_ws/src/transbot_nav/maps/map.sh # Method 2
The map will be saved this path: ~/rplidar_ws/src/transbot_nav/maps/
one pgm picture,one yaml file.
map.yaml
xxxxxxxxxx
image: map.pgm
resolution: 0.05
origin: [-15.4,-12.2,0.0]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196
Parameter analysis:
View tf tree
xxxxxxxxxx
rosrun rqt_tf_tree rqt_tf_tree
View node
xxxxxxxxxx
rqt_graph