Welcome to EAI X3 Pro LiDAR repository
2.Handheld lidar mapping
Handheld lidar mapping
The following workspace contains the entire function package in ydlidar_ws.
If you need to transplant it to your own development board, you need to copy all the function packages to the src of the workspace for compilation, and install the relevant environment according to the actual situation.
The approximate steps are as follows, taking ros1-melodic as an example:
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-devros-melodic-teleop-twist-keyboard ros-melodic-moveit-resources ros-melodic-navigation ros-melodic-gmapping ros-melodic-hector-slam ros-melodic-slam-kartoros-melodic-robot-state-publisher ros-melodic-geographic-msgs ros-melodic-libuvc-* ros-melodic-rtabmap-ros libavformat-dev libavcodec-dev libswresample-devlibswscale-dev libavutil-dev libsdl1.2-dev ros-melodic-pointcloud-to-laserscanros-melodic-mbf-msgs ros-melodic-mbf-costmap-core ros-melodic-costmap-converterros-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-msgsros-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*
1. Start the mapping command
Input following command:
xxxxxxxxxxroslaunch ydlidar_ros_driver test_gmapping.launchIf the following screen appears, it means the operation is successful.

2. Save map
Input following command:
xxxxxxxxxxrosrun map_server map_saver -f ~/ydlidar_ws/src/ydlidar_ros_driver-master/maps/map
The map will be saved to the path ~/ydlidar_ws/src/ydlidar_ros_driver-master/maps
A pgm picture and a yaml file.
map.yaml
xxxxxxxxxximage/home/yahboom/ydlidar_ws/src/ydlidar_ros_driver-master/maps/map.pgmresolution0.050000origin-10.000000 -10.000000 0.000000negate0occupied_thresh0.65free_thresh0.196Parameter analysis:
image: The path of the map file, which can be an absolute path or a relative path.
resolution: resolution of the map, meters/pixel
Origin: 2D pose (x, y, yaw) in the lower left corner of the map. The yaw here is rotated counterclockwise (yaw=0 means no rotation
change). Many parts of the current system ignore the yaw value.
negate: whether to reverse the meaning of white/black and free/occupied (the interpretation of the threshold is not affected)
occupied_thresh: Pixels with an occupation probability greater than this threshold will be considered fully occupied.
free_thresh: Pixels with occupancy probability less than this threshold will be considered completely free.
3. View related information
View tf tree
xxxxxxxxxxrosrun rqt_tf_tree rqt_tf_tree
View node communication
xxxxxxxxxxrosrun rqt_graph rqt_graph
4. Algorithm information reference website
4.1 Mapping algorithm
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/
4.2 Autonomous mapping navigation
rrt_exploration:http://wiki.ros.org/rrt_exploration
rrt_exploration/Tutorials:http://wiki.ros.org/rrt_exploration/Tutorials
4.3 Save map
map_server:https://wiki.ros.org/map_server