Welcome to ROSMASTER A1 repository
4.Docker Startup Script
Docker Startup Script
1. Check Bound Devices
The A1 robot has three bound devices. After booting successfully, enter the following command to check if the binding is successful.
- Checking the ROS expansion board binding status
ll /dev/myserialIf the following image appears, the binding is successful.

- Checking the radar binding status
xxxxxxxxxxll /dev/rplidarIf the following image appears, the binding is successful.

- Checking the AI voice broadcast module binding status
xxxxxxxxxxll /dev/myspeechIf the following image appears, the binding is successful.

If you purchased a depth camera, you can also enter the following command to check whether the depth camera is successfully bound.
xxxxxxxxxxll /dev/as_cameraIf the following image appears, the binding is successful.

2. Check the Script Definition
On the Raspberry Pi or Jetson Nano host, enter the following command to open the Docker script.
xxxxxxxxxxsudo gedit run_humble.shPress Enter to see the script contents.

Below is a brief description of each line of the Docker script. Its main function is to open a Docker container and map the hardware devices connected to the Raspberry Pi to the Docker container. This allows Docker to freely access peripherals connected to the Raspberry Pi's interface.
xxxxxxxxxxxhost + # Allow the container to access the host's X11 display service, thus providing visualization capabilities for Docker.docker run -it \--net=host \ # Container uses the host's network stack directly.--privileged \ # Access all hardware devices.--env="DISPLAY" \ # Pass the visualization environment variable.--env="QT_X11_NO_MITSHM=1" \--security-opt apparmor:unconfined \ # Disable security policy when visualization is disabled.-e PULSE_SERVER=unix:/run/user/1000/pulse/native \ # PulseAudio service path-e ALSA_CARD=0 \-v /run/user/1000/pulse:/run/user/1000/pulse:ro \ # Mount the audio socket read-only-v ~/.config/pulse:/root/.config/pulse:ro \-v /etc/localtime:/etc/localtime:ro \ # Synchronize local time-v /etc/timezone:/etc/timezone:ro \-v /tem/.X11-unix:/tmp/.X11-unix \-v ~/share:/root/share \ # Shared folder between the host and Docker--device /dev/snd \ # Access the host sound card-v /dev/input:/dev/input \ #Mount all input devices (mouse/keyboard)-v /dev/myserial:/dev/myserial \ #Mount the ROS expansion board-v /dev/myspeech:/dev/myspeech \ #Mount the AI module serial port-v /dev/rplidar:/dev/rplidar \ #Mount the radar-v /dev/as_camera:/dev/as_camera \ #Mount the depth camera192.168.2.51:5000/ros-humble-a1:1.0.6 /bin/bash #Select the Docker name to runNote that the mounted peripherals are recognized properly and that the Docker container you want to run exists. A shared folder will be created on the host machine. You can store files or photos you want to transfer to the Docker container in this folder.

3. Run the Docker Script
When using the IP address on the OLED screen to access VNC remotely, you can open a terminal and run the following command to enter Docker:
xxxxxxxxxx./run_humble.shSuccessful:

Since the robot has two cameras and two different radar models, the factory system has routines configured for multiple devices. However, since it cannot automatically identify the product, you need to manually set the machine type and radar model. Enter in the terminal:
xxxxxxxxxxroot@raspberrypi:/# cdroot@raspberrypi:~# vim .bashrc

After modifying your peripherals, save and exit vim, then execute:
xxxxxxxxxxsource .bashrc
You can see the modified car model, radar type, and camera type.
To view the shared folder, enter the following command:
xxxxxxxxxxroot@raspberrypi:~# cd share/root@raspberrypi:~/share# ls
We can see a .db file and a compressed archive. The same files are also present on the Raspberry Pi.

This principle can be used to transfer files between the host machine and Docker.