深圳市璞数技术有限公司
PAGE 11 OF 15
§2.3 YZ-01 ROS demo instruction:
2.3.1 Do gmapping SLAM to generate a map of your office:
1
)
Preparing work:
Your desktop PC is ready:
Please make sure your desktop or laptop PC
was installed ROS KINETIC. Otherwise, please install ROS on your PC
firstly. Then copy the rbx1_nav source folder from robot PC to your
desktop PC ROS work space src folder, and then on your desktop PC run
catkin_make command to compile this rbx1_nav package;
YDLIDAR is connected;
Joystick is connected;
2
)
Run gmapping command on your robot PC
.
Use SSH command to open a SSH terminal (password is 1) from your
desktop PC to remote login robot PC, and then launch:
$ roslaunch stm32_connect start_basecontrol.launch
$ roslaunch rbx1_nav yz_gmapping_by_ydlidar.launch
You can look over the gmapping_
by_ydlidar.launch
file and learn more
details about this launch command.
3
)
Run RVIZ on your desktop PC ternimal
Due the running robot has not a monitor and SSH can not provide
graphical remote login, so we need run RVIZ on your desktop PC instead.
Before run RVIZ, please let your desktop PC
’
s ROS MASTER redirect to
robot PC ROS core:
$ export ROS_MASTER_URI=http://robot IP:11311
$ rosrun rviz rviz -d `rospack find rbx1_nav`/gmapping.rviz
If everything OK, you can see some map pixel on the screen.
4)
Drive robot moving and save map data on your robot PC
Use joystick to drive robot slowly walking around your office, until all
roads are covered. Then stop robot.
Use SSH to remote login robot PC from your desktop PC, then
$ rospackcd rbx1_nav/maps
$ rosrun map_server map_saver -f my_map
“
my_map
”
the name of this new map. You can find this new map
files in rbx1_nav/maps folder.