yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
EAI X3 Pro LiDAR📖
01.Linux basic course
  • 1.Introduction to Linux system
  • 2.Ubuntu file system
  • 3.Ubuntu common commands
  • 4.Ubuntu common editors
  • 5.Ubuntu software operation commands
  • 6.Virtual machine installation
  • 7.SSH remote control
  • 8.VNC remote control
  • 9.Transfer files remotely
  • 10.Driver library and communication
  • 11.Static IP and hotspot mode
  • 12.Bind device ID
  • 13.Capacity expansion and resource allocation
  • 14.Update system software sources
  • 15.Set root user password
  • 16.sudo free password
  • 17.Connect to WiFi network
  • 18.View system version
  • 19.Customized service management
  • 20.Back up system image
02.ROS1 basic course
  • 1.ROS introduction
  • 2.ROS installation
  • 3.ROS common command tools
  • 4.ROS workspace
  • 5.ROS function package
  • 6.ROS node
  • 7.ROS topic publisher
  • 8.ROS topic subscribers
  • 9.ROS service client
  • 10.ROS service server
  • 11.ROS action client
  • 12.ROS action server
  • 13.ROS custom message reception
  • 14.ROS-launch file
  • 15.ROS-TF transformation
  • 16.ROS parameter service
  • 17.ROS-rviz use
  • 18.ROS-rqt tool usage
  • 19.Topic message recording and playback
  • 20.urdf model introduction
  • 21.gazebo introduction
  • 22.ROS distributed communication
03.ROS1 lidar course
  • 0.Instructions before use
  • 1.Preparation
  • 2.Handheld lidar mapping
  • 3.Lidar avoiding
  • 4.Lidar guard
  • 5.Lidar follow
  • 6.Lidar mapping
  • 7.rrt_exploration mapping algorithm
  • 8.Navigation
  • 9.APP Mapping and Navigation
  • 10.RTAB 3D mapping and navigation
04.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
05.ROS2 lidar course
  • 0.ReadMe
  • 1.Preparation
  • 2.Handheld lidar mapping
  • 3.Lidar avoiding
  • 4.Lidar follow
  • 5.Lidar guard
  • 6.Lidar patrol
  • 7.gmapping mapping
  • 8.cartographer mapping
  • 9.Navigation and avoiding
  • 10.APP Mapping and Navigation
  • 11.RTAB 3D mapping and navigation
06.RPi 5 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
  • 7.Docker container to install ROS using accessories
07.RDK course
  • 0.ReadMe before use
  • 1.Environment Construction
  • 2.Handheld Lidar Mapping
Download
  • ROS1-Code
  • ROS2-Code
  • ROS1-VMFile
  • ROS2-VMFile
  • PC Software
  • 3D_Model_File
  • RDK_Code
  • ROS2_Basic_VM
Download ZIP

Welcome to EAI X3 Pro LiDAR 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

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文