PI4 version steps:
Press the power switch on the side of the mechanical dog and wait for the mechanical dog to start up. And connect the robot dog's WiFi to the same LAN environment as the computer.
After the mechanical dog is started, the laser radar, imu, and mechanical dog joint status nodes have been automatically started.
If you find that you cannot obtain lidar and other data, please close the mechanical dog program and restart the chassis program.
To close the large program, restart the chassis and modify the multi-level communication ID, please refer to the tutorial: 14. Radar mapping navigation\6. Obtaining the status of the physical mechanical dog in the ROS2 environment\Acquiring the real joint data of the mechanical dog in the ROS2 environment.pdf
PI5 version steps:
Press the power switch on the side of the mechanical dog and wait for the mechanical dog to start up. And connect the robot dog's WiFi to the same LAN environment as the computer.
After the mechanical dog is started, remotely connect to the mechanical dog through the IP address on the OLED.
Then ctrl+c closes the large program and enter the following command to enter docker:
xxxxxxxxxx
./run_humble.sh
Then enter the following commands in the docker terminal to start the car radar, imu, and mechanical dog joint status nodes.
xxxxxxxxxx
ros2 launch bringup Navigation_bringup.launch.py
Note: The default virtual machine has been installed here.
Open the virtual machine, enter the password: yahboom and press the Enter key to enter the system desktop.
Note: This step is the same for virtual machines of PI4 and PI5 versions
Then double click on the cartoros2 folder
Then right-click in an empty space of the folder and select Open in Terminal
Then enter the following command in the terminal to activate the environment
xxxxxxxxxx
source install/setup.bash
After completing the input, press the Enter key.
Then enter the following command and press Enter to start rosbridge
xxxxxxxxxx
ros2 launch rosbridge_server rosbridge_websocket_launch.xml
Then press the shortcut key: ctrl + shift + t
Enter the command in the newly opened terminal
xxxxxxxxxx
source install/setup.bash
ros2 launch yahboom_bringup Mapping_bring.launch.py
Then press the Enter key to start drawing.
Click on the terminal and press the shortcut key: ctrl + shift + t
Enter the command in the terminal to start the point cloud publishing node:
xxxxxxxxxx
source install/setup.bash
ros2 run laserscan_to_point_pulisher laserscan_to_point_pulisher
Click on the terminal and press the shortcut key: ctrl + shift + t
Enter the command in the terminal to start the positioning publishing node:
xxxxxxxxxx
source install/setup.bash
ros2 launch robot_pose_publisher_ros2 robot_pose_publisher_launch.py
PI4 version steps:
Click on the terminal and press the shortcut key: ctrl + shift + t
Enter the command in the terminal to remotely connect to the robot dog. Currently, the robot dog and the virtual machine are in the same LAN. The IP of the robot dog is: 192.168.2.79. In actual operation, it depends on the specific IP address of your own robot dog.
xxxxxxxxxx
ssh -p 22pi@192.168.2.79
Press Enter and enter yes, then enter the login password of the mechanical dog: yahboom
Then enter the command to start the camera in the terminal:
xxxxxxxxxx
ros2 launch usb_cam demo_launch.py
PI5 version steps:
Open a terminal in the virtual machine, enter the IP on the mechanical dog, and log in remotely. The example IP here is 192.168.2.145.
xxxxxxxxxx
ssh -p 22pi@192.168.2.145
Press Enter and enter yes, then enter the login password of the mechanical dog: yahboom
Then enter docker ps to view the current ID, and then enter the command to enter the same docker
xxxxxxxxxx
docker ps
docker exec -it (id)/bin/bash
Then enter the command to start the camera in the terminal:
xxxxxxxxxx
ros2 launch usb_cam camera.launch.py
Open the mobile APP ROS Robot
Enter the IP address of the virtual machine. Take the current virtual machine IP as: 192.168.2.117 as an example. At the same time, select the camera topic of the mechanical dog as /usb_cam/imge_raw/compress and select ros2.
Then swipe down and click Connect.
After entering the map interface, you can see the map scanned by the radar and the camera image.
Swipe down to see the remote sensing control in the lower right corner. You can use remote sensing to control the mechanical dog for mapping.
When the map scan is completed, we press the shortcut key Ctrl shift t in the terminal to reopen a terminal window and enter the following command
First enter the following command to activate the environment
xxxxxxxxxx
source install/setup.bash
Then enter the following command to stop mapping,
xxxxxxxxxx
ros2 service call /finish_trajectory cartographer_ros_msgs/srv/FinishTrajectory "{trajectory_id: 0}"
Then enter the following command to save the pbstream file
x#pi4
ros2 service call /write_state cartographer_ros_msgs/srv/WriteState "{filename: '/home/yahboom/cartoros2/data/maps/mymap.pbstream'}"
#pi5
ros2 service call /write_state cartographer_ros_msgs/srv/WriteState "{filename: '/home/yahboom/yahboomcar_ws/maps/mymap.pbstream'}"
The path of the filename parameter is the path where the pbstream file of the map is saved.
Finally enter the following command to convert the pbstream file to a pgm file.
xxxxxxxxxx
#pi4
ros2 run cartographer_ros pbstream_to_ros_map_node -map_filestem=/home/yahboom/cartoros2/data/maps/mymap -pbstream_filename=/home/yahboom/cartoros2/data/maps/mymap.pbstream -resolution=0.05
#pi5
ros2 run cartographer_ros cartographer_pbstream_to_ros_map -map_filestem=/home/yahboom/yahboomcar_ws/maps/mymap -pbstream_filename=/home/yahboom/yahboomcar_ws/maps/mymap.pbstream -resolution=0.05