yahboom
HomeTutorialsProduct
Solution
Blog
Online Store
About Us
EN/中文
Store
Raspbot V2📖
1.About Raspbot V2
  • 1. First trial
  • 2. Expansion board interface distribution
  • 3. About battery and charging
  • 4. Install servo PTZ
  • 5.Servo Gimbal Installation
  • 6. Important Notes (Read Before Starting)
2.Assembly
  • Installation Video
3.Car basic course
  • 0. Preparation before development
  • 1.Buzzer control
  • 2.Key reading
  • 3.RGB control
  • 4.Servo control (PTZ control)
  • 5.Motor control
  • 6.Printing ultrasonic data
  • 7.Tracking module status printing
  • 8.IR control key value printing
4.Car motion control course
  • 0.Mecanum wheel motion principle
  • 1.Car vertical movement
  • 2.Car diagonal movement
  • 3.Car sideways movement
  • 4.Car rotation movement
  • 5.Car patrol
5.Car advanced courses
  • 1.Infrared patrol car
  • 2.Ultrasonic avoid
  • 3.Ultrasonic follow
  • 4.Infrared tracking+ ultrasonic avoid
  • 5.Restricting
  • 6.Infrared remote control car
6.OpenCV courses
A. Getting Started with OpenCV
  • 1. Introduction to OpenCV
  • 2.OpenCV image reading and display
  • 3. OpenCV image writing
  • 4. OpenCV Image Quality
  • 5.OpenCV pixel operations
B. OpenCV geometric transformation
  • 1. Image scaling
  • 2. Image cutting
  • 3. Image translation
  • 4. Image mirroring
  • 5. Affine Transformation
  • 6. Image Rotation
  • 7. Perspective Transformation
C. OpenCV image processing and text line drawing
  • 1. Grayscale processing
  • 2. Image Binarization
  • 3. Edge Detection
  • 4. Line drawing
  • 5. Rectangle and circle drawing
  • 6. Text and image drawing
D. Image beautification
  • 1. Color Image Histogram
  • 2. Histogram Equalization
  • 3. Image repair
  • 4. Brightness enhancement
  • 5. Smooth and whiten
  • 6. Gaussian mean filtering
  • 7. Median Filter
E. Machine Learning
  • 1. KNN
  • 2. SVM
7.AI vision recognition course
  • 1.Camera driver tutorial
  • 2.Color recognition
  • 3.HSV value test
  • 4.Object Recognition
  • 5.QR code recognition
  • 6.Face recognition
  • 7.License Plate Recognition
  • 8. Human Pose Estimation
  • 9. Target detection
  • 10.yolov5-lite
  • 11. Gesture Recognition
  • 12. Face Detection
  • 13. Face effects
  • 14. 3D Object Recognition
  • 15. Paintbrush
  • 16. Finger control
8.AI vision interaction module
  • 1. Color tracking
  • 2. Color follows
  • 3. QR code recognition to control movement
  • 4. Face tracking
  • 5. Face following
  • 6. Visual tracking
  • 7. Garbage identification
  • 8. Track map Autopilot(purchased separately)
  • 9. Gesture following
9.Voice control basic course(For Superior Kit)new
  • 1.Voice control car movement
  • 2.Voice control RGB light
  • 3.Voice control color recognition
  • 4.Voice control autonomous driving
  • 5.Voice control car tracking
10.AI large model knowledge(For Superior Kit)new
  • 1.AI large model types and principles
  • 2.RAG retrieval enhancement and model training samples
  • 3.Embodied intelligent robot system architecture
  • 4.Embodied intelligent functions core source code
  • 5.Configure AI large model(Required)
11.AI Large Model Development(For Superior Kit & Reference)new
  • 1.Register a model service provider account
  • 2. Configuring API-KEY(Optional)
  • 3. Introduction to Dify
  • 4. Basic Dify Features
  • 5. Deploy the RAG knowledge base
  • 6. AI Large Model Development - chatbot
  • 7. RAG knowledge base + chatbot
  • 8. AI agent workflow
  • 9. Custom wake-up response
  • 10. Core module testing tools
12.AI large basic course(For Superior Kit)new
  • 1.Free conversation
  • 2.Text-to-picture
  • 3.Scene description
  • 4.Video description
  • 5.Intelligent action choreography
  • 6.Dual-model agent application
13.ROS2-Robot chassis control course
  • 1. Robot information release
  • 2. Robot keyboard control
  • 3. URDF Model
14.ROS2-OpenCV course
  • 1.ROS+Opencv application
  • 2. AR Vision
  • 3. Mediapipe fun gameplay
  • 4. Gesture control car movement
  • 5. Gesture control car actions
  • 6. Palm control car movement
  • 7. Palm control servo PTZ
  • 8. Visual tracking
  • 9. AprilTag code recognition
  • 10. AprilTag tag code tracking
  • 11. AprilTag tag code follow
15.Development environment course
  • 1. Introduction to Raspberry Pi 5
  • 2. Image writing and backup
  • 3. Start the Raspberry Pi 5
  • 4. Remote Access
  • 5. Remote file transfer
  • 6. Common Linux commands and use of vim editor
  • 7. Install Raspbot V2 driver library
  • 8. Jupyter Lab environment construction
  • 9. Jupyter Lab plugin installation
  • 10. Basic use of Jupyter Widgets
16.Raspberry Pi basic settings
  • 1.Update and upgrade the operating system
  • 2. Introduction to raspi-config tool
  • 3. config.txt file description
  • 4. Network Configuration
  • 5. Set display resolution and rotation
  • 6. Set screen sleep
  • 7. Get real-time temperature of RPi
  • 8. Play audio and video
  • 9. Use USB Camera
  • 10.Use MIPI camera
17.Docker course
  • 1. Overview and installation
  • 2. Common commands
  • 3. Understand and publish images
  • 4. Docker data processing
  • 5. Enter docker container
18.ROS2 basic course
  • 1. Introduction to ROS2
  • 2.ROS2 install Humble
  • 3. ROS2 development environment
  • 4. ROS2 workspace
  • 5. ROS2 function package
  • 6. ROS2 node
  • 7.ROS2 topic communication
  • 8. ROS2 service communication
  • 9. ROS2 action communication
  • 10. ROS2 custom interface message
  • 11. ROS2 parameter service case
  • 12. ROS2 meta-function package
  • 13. ROS2 distributed communication
  • 14. ROS2 DDS
  • 15. ROS2 time related API
  • 16. ROS2 common command tools
  • 17. ROS2 rviz2 use
  • 18. ROS2 rqt toolbox
  • 19. ROS2 Launch startup file configuration
  • 20. ROS2 recording and playback tool
  • 21. ROS2 URDF model
  • 22. ROS2 Gazebo simulation platform
  • 23.ROS2 TF2 coordinate transformation
Download
  • APP(iOS/Android)
  • Code
  • System_File
  • Instruction Manual
  • Hardware_Info
  • 3D_Model_File
  • ROS2_Basic_VM
Download ZIP

Welcome to Raspbot V2 repository

当製品の日本語版マニュアル資料は、こちらからご取得ください。

5. Enter docker container

 

Enter docker container

 

Enter docker container5.1, related concepts5.2, How to query the docker image version used by the robot5.3. Edit scripts5.4, Execute the script5.5. multiple terminals enter the same docker container5.6, how to open a container that is already in the [Exited] closed state5.6.1, re-enter the container in the [Exited] closed state

5.1, related concepts

  1. What is the host of docker
The host is the server where we call commands to create containers using images. Here it refers to the main control Raspberry Pi on our car, and the host mentioned below refers to this.
  1. What is GUI
xxxxxxxxxx
GUI is a graphical user interface, which mainly refers to: image window displayed by opencv, rviz interface, rqt interface, etc.
  1. What is the docker container of the robot
xxxxxxxxxx
The robot here is the raspbot v2 car, that is, the raspbot v2 car container with various development dependent environments configured
  1. Before operating this chapter tutorial, please make sure that you have mastered the knowledge of the following chapters, otherwise you may find it difficult to learn. In this case, please check the following pre-knowledge content repeatedly, and you will feel very relaxed after mastering it. Come on, you are the best!

image-20230519094253521

5.2, How to query the docker image version used by the robot

  1. The docker image version used by the robot is also the image version used on the car. After the user burns the system image of the car and starts it, execute:
xxxxxxxxxx
docker images

Please select the name [yahboomtechnologyros-humble]. The version with the highest tag is the latest image version of the robot

  1. Why can't we just put one docker image in the car system?

If you have read the tutorial in [13, Docker ------ 3, docker image in-depth understanding and release image], you should know that docker image is a layered mechanism, that is, the image of the latter tag depends on the image of the previous tag. Therefore, there may be multiple versions of docker images in the host machine, and the tags of these images will be updated in an incremental manner.

Later, when we update new courses, we will also update functions by releasing new docker images.

5.3. Edit scripts

Edit the script to run docker. This step is performed on the host machine:

  1. The script to run docker [docker_ros2.sh] is generally placed in the root directory of the car's home directory. I am in the following path. If you don't have it, you can create the file yourself. Remember to give the script executable permissions after creation.
xxxxxxxxxx
chmod +x docker_ros2.sh #Give the script executable permissions

image-20230423164551252

The contents of the [docker_ros2.sh] script are as follows:

You can copy it directly without comments and modify it as needed

Note: When adding a host device to a container below, if the host machine is not connected to the device, you need to remove the corresponding addition operation to start the container

xxxxxxxxxx
#!/bin/bash
xhost +
docker run -it \
--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 \
-v /dev/i2c-1:/dev/i2c-1 \
-v /dev/i2c-0:/dev/i2c-0 \
--device=/dev/video0 \
--device=/dev/video1 \
--device=/dev/gpiomem \
yahboomtechnology/ros-humble:0.1.0 /bin/bash

Annotated script description:

Note: When adding a host device to a container, if the host is not connected to the device, you need to remove the corresponding addition operation to start the container.

​x
#!/bin/bash
xhost +                                                             # xhost is used to support the display of GUI in docker

docker run -it \                                                    # interactively run docker image
--net=host \                                                        # set the container network to host mode
--env="DISPLAY" \                                                   # open the display GUI interface
--env="QT_X11_NO_MITSHM=1" \                                        # use X11 port 1 for display
-v /tmp/.X11-unix:/tmp/.X11-unix \                                  # map the display service node directory
--security-opt apparmor:unconfined \
-v /home/pi/temp:/root/temp \                                       # as a temporary file transfer directory between the host and the container, if you need to transfer files, you can use this directory
-v /dev/i2c-1:/dev/i2c-1 \                                          # add the host device to the container, i2c device port, if the car is not connected, please remove this line
-v /dev/i2c-0:/dev/i2c-0 \                                          #Add host device to container, i2c device port, if the car is not connected, please remove this line
--device=/dev/video0 \                                              #Add host device to container, camera device port, if the car is not connected to the camera, please remove this line
--device=/dev/video1 \                                              #Add host device to container, camera device port, if the car is not connected to the camera, please remove this line
--device=/dev/gpiomem \                                             #Add host device to container, Raspberry Pi gpio device port
yahboomtechnology/ros-humble:0.1.0 /bin/bash                        #The image name to be started, according to the modification found in step 5.2; execute the /bin/bash command in the container
#Note: When adding the host device to the container above, if the host is not connected to the device, you need to remove the corresponding addition operation to start the container

5.4, Execute the script

Note: This must be executed on the VNC of the car or on the car screen. It cannot be executed in the car terminal remotely entered through ssh (such as the car terminal entered through MobaXterm). Otherwise, the GUI image may not be displayed in the container. As shown below, after entering the car terminal in MobaXterm and executing run_docker.sh to enter the container, rviz cannot be displayed

image-20230423173220146

Execute on the VNC interface of the car or on the car screen:

xxxxxxxxxx
./docker_ros2.sh

You can enter the container correctly and display the GUI screen. You can execute the rviz2 command again for testing.

image-20230423171929960

If the GUI cannot be displayed after executing the rviz2 command, the following error is displayed: (usually it may appear in the Raspberry Pi master)

image-20230509173232054

You need to add another parameter to the startup script:

xxxxxxxxxx
--security-opt apparmor:unconfined

That is:

xxxxxxxxxx
#!/bin/bash
xhost +
docker run -it \
--privileged=true \
--net=host \
--env="DISPLAY" \
--env="QT_X11_NO_MITSHM=1" \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--security-opt apparmor:unconfined \ #Parameters for this sentence
-v /home/pi/temp:/root/temp \
-v /dev/i2c-1:/dev/i2c-1 \
-v /dev/i2c-0:/dev/i2c-0 \
--device=/dev/video0 \
--device=/dev/video1 \
--device=/dev/gpiomem \
yahboomtechnology/ros-humble:0.1.0 /bin/bash

Then run the script again to enter the container and display the GUI screen.

5.5. multiple terminals enter the same docker container

 

  1. In the above steps, a docker container has been opened. You can open another terminal on the host (car) to view it:
xxxxxxxxxx
docker ps
  1. Now open a new terminal and enter the same docker. Change the following da8c4f47020a to the ID displayed in the actual terminal
xxxxxxxxxx
docker exec -it da8c4f47020a /bin/bash

image-20230423182446607

After successfully entering the container, you can open countless terminals to enter the container.

The robot project files are stored in the following directory:

xxxxxxxxxx
/root/yahboomcar_ws

5.6, how to open a container that is already in the [Exited] closed state

5.6.1, re-enter the container in the [Exited] closed state

Open the terminal on the docker host [i.e. the car, which can be executed on VNC or on the car screen]

Note: This must be executed on the car's VNC or on the car screen, and cannot be executed in the car terminal remotely entered through ssh (such as the car terminal entered through MobaXterm), otherwise the GUI image may not be displayed in the container. Of course, if you do not need to display the GUI image, then it is OK.

  1. First check the status of the container
xxxxxxxxxx
docker ps -a
  1. Enable GUI access
xxxxxxxxxx
xhost +
  1. Enable the container [the container ID here can be abbreviated as long as it can uniquely identify the existing container]
xxxxxxxxxx
docker start 5b
  1. Enter the container again
xxxxxxxxxx
docker exec -it 5b /bin/bash
  1. Open rviz to check whether the GUI screen can be opened
xxxxxxxxxx
rviz2
  1. The specific execution is as follows:
xxxxxxxxxx
pi@yahboom:~$ docker ps -a
CONTAINER ID   IMAGE                              COMMAND       CREATED      STATUS                     PORTS     NAMES
5b698ea10535   yahboomtechnology/ros-foxy:3.3.9   "/bin/bash"   3 days ago   Exited (0) 8 seconds ago             ecstatic_lewin
pi@yahboom:~$ xhost +
access control disabled, clients can connect from any host
pi@yahboom:~$ docker start 5b
5b
pi@yahboom:~$ docker exec -it 5b /bin/bash
root@yahbooom:/# rviz2
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
[INFO] [1682298616.634096279] [rviz2]: Stereo is NOT SUPPORTED
[INFO] [1682298616.634576375] [rviz2]: OpenGl version: 3.1 (GLSL 1.4)
[INFO] [1682298617.959654036] [rviz2]: Stereo is NOT SUPPORTED

 

Docker data processing
Introduction to ROS2

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文