Welcome to DOFBOT-Pi repository
5.Start the Dofbot container
Start the Dofbot container
The ROS environment and the Dofbot hardware control case are both located in Docker. Every time we run the case, we need to start the corresponding container of Dofbot.
xxxxxxxxxxStarting docker yourself is necessary to run a single case or personal development.
Preliminary preparation
Note: The startup program must be closed to run a single case!
For the tutorial on closing the large startup program, please refer to the tutorial [Preparation before development: Closing the large startup program].
xxxxxxxxxx[Preparation before development: Close the startup program]: The tutorial provides temporary/permanent shutdown of the startup program and shutdown/restoration of the startup Docker script operation!
For first-time users, I recommend temporarily closing the startup program. For simple developers, you can try closing the startup program permanently.
xxxxxxxxxxIf the recovery of the large boot program fails permanently, you can follow the tutorial to reverse the recovery or burn the system yourself to restore the factory mode.
Start Docker
We provide the script file Docker_Ros.sh for running the docker image corresponding to Dofbot in the home directory on the Raspberry Pi 5 motherboard.
xxxxxxxxxx2#!/bin/bash# Wait for the Docker service to startwhile true; do if systemctl is-active --quiet docker; then echo "Docker service has been started" break else echo "The Docker service has not started, waiting..." sleep 1 fidone# Docker startxhost +docker run -it --rm \--privileged=true \--net=host \--env="DISPLAY" \--env="QT_X11_NO_MITSHM=1" \-v /tmp/.X11-unix:/tmp/.X11-unix \--security-opt apparmor:unconfined \-v /home/pi/Temp:/root/Temp \--device=/dev/video0 \--device=/dev/i2c-1 \192.168.2.51:5000/dofbot_ai:3.0.1 /bin/bashStart command
xxxxxxxxxx./Docker_Ros.sh
Precautions
If the hardware device is not connected correctly, starting docker may fail!
Example: USB camera
If the camera is not connected or the one identified is not /dev/video0, Docker may not be able to enter correctly or the camera case will report an error.
If you need to cancel the hardware mapping of the USB camera, we can delete the corresponding --device=/dev/video0\ information in the startup script.
x
# Wait for the Docker service to startwhile true; do if systemctl is-active --quiet docker; then echo "Docker service has been started" break else echo "The Docker service has not started, waiting..." sleep 1 fidone# Docker startxhost +docker run -it --rm \--privileged=true \--net=host \--env="DISPLAY" \--env="QT_X11_NO_MITSHM=1" \-v /tmp/.X11-unix:/tmp/.X11-unix \--security-opt apparmor:unconfined \-v /home/pi/Temp:/root/Temp \--device=/dev/i2c-1 \192.168.2.51:5000/dofbot_ai:3.0.1 /bin/bash