yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
Raspberry Pi 4B📖
1.Preparation before use
  • 1.1 Download image
  • 1.2 Write image into SD card
  • 1.3 Start up Raspberry Pi
  • 1.4 Linux common commands
  • 1.5 Precautions
2.Basic course
  • 2.1 Log into Raspberry Pi system
  • 2.2 Change password and root account
  • 2.3 Remote transfer file
  • 2.4 Backup image file
  • 2.5 Fixing Raspberry Pi IP
  • 2.6 Set screen keep on
  • 2.7 Get Pi temperature
  • 2.8 Connect WIFI
  • 2.9 Modify Pi time
  • 2.10 Set the boot self-starting program
3.Expand course
  • 3.1 Serial port communicates with external devices
  • 3.2 2.Serial port login Pi
  • 3.3 Configured as a router
  • 3.4 Install Jupyter Lab
  • 3.5 Install Jupyter Widgets
  • 3.6 More Detail for Widgets
  • 3.7 Install OpenCV
  • 3.8 Install Tensorflow
4.Programming course
C language
  • 1.Development environment
  • 2.Print Hello World
  • 3.Pin output level
  • 4.Read pin level
  • 5.PWM output
Python language
  • 1.Development environment
  • 2.Print basic usage
  • 3.Pin output level
  • 4.Read pin level
  • 5.PWM output
5.AI vision course
A.Getting started with OpenCV
  • 6.Picture Rotation
  • 1.Introduction of OpenCV
  • 2.OpenCV image read and display
  • 3.OpenCV image write
  • 4.OpenCV image quality
  • 5.OpenCV pixel operation
B.OpenCV Geometric transformat
  • 1.Picture Zoom
  • 2.Picture Cut
  • 3.Picture Shift
  • 4.Picture Mirroring
  • 5.Affine Map
  • 7.Perspective Transformation
C.OpenCV picture processing
  • 1.Grayscale processing
  • 2.Image Binarization
  • 3.Edge detection
  • 4.Drawing line segment
  • 5.Drawing rectangle circle
  • 6.Drawing text picture
D.OpenCV image beautification
  • 1.Histogram of color pictures
  • 2.Histogram equalization
  • 3.Image restoration
  • 4.Brightness enhancement
  • 5.Skin whitening
  • 6.Gaussian mean filtering
  • 7.Median filtering
F.AI Advanced Course (Ubuntu system)
  • 1. QR code
  • 2. Human posture estimation
  • 3. Target detection
  • 4. Mediapipe development
  • 5. yolov4-tiny
E.Install TensorFlow
  • Install TensorFlow
6.ROS1 coursenew
Basic Course
  • 1.ROS introduction
  • 2.Project file structure
  • 3.Common commands and tools
  • 4.Publisher
  • 5.Subscribers
  • 6.Customize topic messages and use
  • 7.Client
  • 8.Server
  • 9.Custom service messages and usage
  • 10.TF release and monitoring
Visual Image Processing
  • 1. AR vision
  • 2. AR QR code
  • 3. ROS+Opencv foundation
  • 4. ROS+Opencv application
  • 5. MediaPipe development
7.ROS2 coursenew
Docker Course
  • 1.Overview and installation
  • 2.Common commands
  • 3.Understand and publish images
  • 4.Hardware interaction data processing
  • 5.Enter docker container
  • 6.Update docker images
Basic Course
  • 1.Introduction to ROS2
  • 2.Commands and tools
  • 3.ROS2 Topic communications
  • 4.ROS2 service communications
  • 5.ROS2launch file starts
OpenCV Course
  • 1.OpenCV Basic Course
  • 2.ROS+opencv application
  • 3.QR code recognition
  • 4.AR Vision
  • 5.Mediapipe
8.Accessories installation
  • 1. Installation of heat sink
  • 2. Wiring of cooling fan
  • 3. Double fan armor case Installation
  • 4. Argon NEO aluminum case installation
  • 5. Argon ONE aluminum alloy case installation
  • 6. Metal shell with built-in fan installation
  • 7. Acrylic case with cooling fan installation
  • 8. White-red ABS protective case installation
Download
  • Tools
  • C_code
  • Python code
  • ROS System
Download ZIP

Welcome to Raspberry Pi 4B repository

5.Enter docker container

 

5.Enter docker container

 

5.Enter docker container5.1、related concepts5.2、How to query the docker image version used by the robot5.3、Binding peripherals5.4、Edit scripts5.5、Execute scripts5.6、multiple terminals enter the same docker container5.7、How to open a container that is already in the [Exited] closed state5.7.1、enter the [Exited] closed container again

 

5.1、related concepts

  1. What is the host of Docker?
xxxxxxxxxx
The host is the server where we call the command to create a container using the image. This refers to our system motherboard (jetson board or Raspberry PI, etc.), and the host machine mentioned below refers to this.
  1. What is GUI?
xxxxxxxxxx
GUI is the graphical user interface, which mainly refers to: the image window displayed by opencv, rviz interface, rqt interface, etc.
  1. What is the docker container
xxxxxxxxxx
When the docker image is open and running, it is the container
  1. Before operating this chapter tutorial, please make sure that you have mastered the knowledge of the following chapters, otherwise you may feel more difficult to learn. In this case, please check the following pre-knowledge content repeatedly, you will feel very relaxed after mastering, 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 mirror version used on the trolley, and the user executes after the system image of the burned trolley is started:

xxxxxxxxxx
jetson@jetson-desktop:~$ docker images
REPOSITORY                     TAG       IMAGE ID       CREATED        SIZE
yahboomtechnology/ros2-base   2.0.1     fce9745648c0   3 days ago      6.5GB
yahboomtechnology/ros2-base   1.0.3     cs41dfas5fx0   3 days ago      6.9GB
yahboomtechnology/ros2-base   1.0.1     31e97028c1c0   3 days ago      7.2GB

You will see that there are multiple docker image versions, please select the name which is the highest tag version is the latest image version of the board. The actual situation is displayed based on the mirror you have queried.

2、Why can't you just put a docker image in the car system?

If you have read the tutorial in the chapter [ Docker ------ 3, docker images to deeply understand and release images], you should know that docker images are layered mechanisms, 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, and the tags of these images will be updated incrementally.

In the future, we will update the new course, and we will also update the function by releasing a new docker image

 

5.3、Binding peripherals

The following uses Radar and serial device bonding as an example

This step is performed on the host::

1、Here is to view peripherals other than the camera

xxxxxxxxxx
ll /dev | grep ttyUSB*

image-20230423172753208

2、View camera device

xxxxxxxxxx
ls /dev/video*

 

5.4、Edit scripts

Then edit the startup script according to the device found in the previous step

The following uses Radar and serial device bonding as an example

Edit the script that runs docker,This step is performed on the host:

1、Create a docker run script [run_usb_docker.sh], It's usually in the home directory

xxxxxxxxxx
chmod +x run_usb_docker.sh            #Give the script executable permissions

【run_usb_docker.sh】The contents of the script are as follows:

Without comments, you can copy it directly and modify it as needed

Note: When adding a host device to a container below, if the host does not have the device connected, you need to remove the corresponding add operation to open the container

​x
#!/bin/bash
xhost +

docker run -it \
--net=host \
--env="DISPLAY" \
--env="QT_X11_NO_MITSHM=1" \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v /home/jetson/temp:/root/yahboomcar_ros2_ws/temp \
--device=/dev/video0 \
--device=/dev/myserial \
--device=/dev/rplidar \
-p 9090:9090 \
-p 8888:8888 \
yahboomtechnology/ros2-base:2.0.2 /bin/bash

 

Here is the annotated script description:

Note: When adding a host device to a container below, if the host does not have the device connected, you need to remove the corresponding add operation to open the container

xxxxxxxxxx
#!/bin/bash
xhost +                # xhost is used to support displaying GUIs in docker

docker run -it \                    # Run docker images interactively
--net=host \                        # The container network is set to host mode
--env="DISPLAY" \                   # Open the display GUI interface
--env="QT_X11_NO_MITSHM=1" \        # Port 1 of X11 is used for display
-v /tmp/.X11-unix:/tmp/.X11-unix \      # map shows the service node directory
-v /home/jetson/temp:/root/yahboomcar_ros2_ws/temp \    # As a directory for the host and container to temporarily transfer files, you can use this directory if you need to transfer files
--device=/dev/video0 \      # Add the video device to the container, No camera connected, please remove this line
--device=/dev/myserial \    # Add the serial device to the container, No serial device connected, please remove this line
--device=/dev/rplidar \     # Add the radar device to the container, No radar device connected, please remove this line
-p 9090:9090 \                                   # Open port
-p 8888:8888 \
yahboomtechnology/ros2-base:2.0.2 /bin/bash      #  The name of the image to be started, according to the modification queried in step 5.2; execute the /bin/bash command inside the container

 

5.5、Execute scripts

After the 5.4 step is completed, ,open the terminal on the host of docker(can be on VNC or on the screen of the board)

Note: Here must be executed on the VNC of the trolley or on the trolley screen, not in the trolley terminal entered remotely through ssh (such as the trolley terminal entered through MobaXterm), otherwise the GUI image may not be displayed in the container,as follows in MobaXterm into the trolley terminal execution run_docker.sh after entering the container, rviz cannot be displayed

image-20230423173220146

Run the startup script you created earlier on the VNC interface or on the screen

(Note: Each time this script is executed, a new container is created from the image.)

xxxxxxxxxx
./run_usb_docker.sh

The container can be entered correctly, and the GUI screen can be displayed, and the rviz2 command test can be executed again.

xxxxxxxxxx
rviz2

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

image-20230509173232054

You need to add another parameter to the startup script:

xxxxxxxxxx
--security-opt apparmor:unconfined 

such as:

xxxxxxxxxx
#!/bin/bash
xhost +

docker run -it \
--net=host \
--env="DISPLAY" \
--env="QT_X11_NO_MITSHM=1" \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--security-opt apparmor:unconfined \                    # Added this parameter
-v /home/jetson/temp:/root/yahboomcar_ros2_ws/temp \
--device=/dev/video0 \
--device=/dev/myserial \
--device=/dev/rplidar \
-p 9090:9090 \
-p 8888:8888 \
yahboomtechnology/ros2-base:2.0.2 /bin/bash

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

 

5.6、multiple terminals enter the same docker container

1、In the above steps, a docker container has been opened, and another terminal can be opened on the host to view:

xxxxxxxxxx
docker ps -a

2、Now enter the docker container in this newly opened terminal:

xxxxxxxxxx
docker exec -it [container id] /bin/bash

example:

Successfully entering the container, you can also open an unlimited number of terminals to enter the container.

3、Note:

(1)When executing the command in step 2, make sure that the container is in the [UP] state

(2)If the container is in the Exited shutdown state, see Step 5.7 below

 

 

5.7、How to open a container that is already in the [Exited] closed state

There are two cases here:: Cameras and other related external equipment changes and Cameras and other related external equipment not changes(See step 5.3 Checking Peripheral Connections)

1、Cameras and other related external equipment changes

If there are changes in the container that need to be preserved, can generate a new image by referring to the following command(See the previous tutorial for detailed steps to publish an image)

xxxxxxxxxx
# Commit an image from the container:
docker commit [container id] [Target image name to be created:[tag]]
For example:docker commit 66c40ede8c68 yahboomtechnology/ros-foxy:1.1  # tag names increment according to your own situation

Then run this new image into the container: see steps 5.2 to 5.5 in this section

2、Cameras and other related external equipment not changes,then directly refer to the [5.7.1、enter the [Exited] closed container again] step to execute.

 

5.7.1、enter the [Exited] closed container again

Open the terminal on the docker's host ( can be on VNC or on the screen of the matherboard )

Note: Here must be executed on the VNC of the board or on the screen of the board, not in the board terminal entered remotely through ssh, otherwise the GUI image may not be displayed in the container, of course, how you do not need to display the GUI image, then you can.

1、First, check the status of the container

xxxxxxxxxx
docker ps -a

2、Enable GUI access permissions

xxxxxxxxxx
xhost +

3、Open the container [the ID of the container here can be abbreviated, as long as it can uniquely identify the container that currently exists]

xxxxxxxxxx
docker start [container ID]

4、Enter the container again

xxxxxxxxxx
docker exec -it [container ID] /bin/bash

5、Open rviz to see if the GUI screen can be opened

rviz2
Hardware interaction data processing
Update docker images

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
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文