yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
YDLIDAR 4ROS 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
Download
  • ROS1-Code
  • ROS1-VMFile
  • ROS2-Code
  • ROS2-VMFile
  • Other File
  • ROS2_Basic_VM
Download ZIP

Welcome to YDLIDAR 4ROS LiDAR repository

7.Docker container to install ROS using accessories

7、Install ROS1ROS2 in docker container

7、Install ROS1/ROS2 in docker container

7、Install ROS1/ROS2 in docker container7.1 Install the corresponding images mirror (ROS environment)7.1.1 Method 1. Download from docke hub warehouse (requires internet connection)ROS1-(melodic)ROS2-(foxy)7.1.2 Method 2: Load from local file (offline)7.2 Usage tips7.3 Using accessories in docker container ROS1/ROS27.3.1 Install device udev rules rule file7.3.2 Write startup script7.3.3 Run the script to enter the container7.3.4 Incoming accessory function package

Raspberry Pi Pi 5 raspios-bookworm
DOCKER HUB repository: https://hub.docker.com/

7.1 Install the corresponding images mirror (ROS environment)

(Use our latest image to skip the 7.1 installation image part!!!)

xxxxxxxxxx
docker pull [latest image version number]
#(All version numbers of the tutorial are subject to the latest)

7.1.1 Method 1. Download from docke hub warehouse (requires internet connection)

ROS1-(melodic)

Use the command on the host:

xxxxxxxxxx
docker pull yahboomtechnology/ros-melodic:1.2 # The latest image version number here is based on the actual modifications seen

image-20231214194555725

ROS2-(foxy)

Use the command on the host:

xxxxxxxxxx
docker pull yahboomtechnology/ros2-foxy:2.0.1 # The latest image version number here is based on the actual modifications seen

image-20231214194703351

After the installation is complete, enter the docker images command to see the image list.

xxxxxxxxxx
pi@raspberrypi:~ $ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
yahboomtechnology/ros2-foxy 2.0.1 4b8a5eee5110 7 days ago 5.61GB
yahboomtechnology/ros-melodic 1.2 1f3f7da97f2b 7 days ago 3.05GB
hello-world latest b038788ddb22 7 months ago 9.14kB

7.1.2 Method 2: Load from local file (offline)

Obtain the .tar compressed package from the network disk data and select the ROS environment you need. image-20231221165130082

Use the command in the directory where the [xxx.tar] file of the host machine is located:

xxxxxxxxxx
docker load -i xxx.tar

This operation takes some time, but rarely fails. image-20231221162423740

After docker load execution is completed, execute:

xxxxxxxxxx
docker images

You can view the updated image and experience the new features image-20231215092406111

If you see the REPOSITORY TAG displayed as <_none>

In order to facilitate the use of subsequent scripts, we need to update the label of the image we pulled.

Command prototype: docker tag <IMAGE_ID> <REPOSITORY_NAME>:<TAG_NAME>

xxxxxxxxxx
docker tag 4b8a yahboomtechnology/ros2-foxy:2.0.1
docker tag 1f3f yahboomtechnology/ros-melodic:1.2

image-20231221163230757

7.2 Usage tips

At this point, the ros environment in docker has been set up. Follow the instructions for the corresponding accessories to enter the docker container and use it.

xxxxxxxxxx
Note: The environments inside the docker container and outside the container (host) are completely independent. If there is a lack of dependent environments, you need to install the relevant dependencies.

 

7.3 Using accessories in docker container ROS1/ROS2

7.3.1 Install device udev rules rule file

xxxxxxxxxx
Note: This step needs to be used according to the tutorial (environment setup or preparation before use) of the corresponding accessory.
Whether you are using ROS1 or ROS2 environment, you only need to bind it once
The rule file .rules is in the /etc/udev/rules.d/ directory
->Here we take Astra camera binding as an example

Terminal input,

xxxxxxxxxx
cd ~/orbbec_ws/src/orbbec-ros-sdk/script
sudo chmod 777 install.sh
sudo bash install.sh

install.sh is mainly a script that executes binding rule files

Mainly done (move xxx.rules to the /etc/udev/rules.d/ directory) operation

The script or startup folder under each function package generally has a .sh script. Each function package is not necessarily named install.sh. Before using it, cd to the directory and ls to see the full name of the script, and then execute it. bash command. If there is no script, you can manually cp the .rules file to the directory and the effect will be the same.

image-20231214144629620

After the installation is complete, it is best to restart.

Enter the following command to verify,

xxxxxxxxxx
#astraproplus
ls -l /dev/astro_pro_plus
#gemini2
ls -l /dev/OrbbecGemini2

The following content appears, indicating that the binding is successful

astraproplusshow image-20231214144640807

gemini2display image-20231214144648832

7.3.2 Write startup script

xxxxxxxxxx
Places to add modifications: (After the Raspberry Pi is connected to accessories, all newly added device numbers need to be mapped to the container)
--device=/dev/xxx #Needs to be replaced with the bound device name
--device=/dev/videox #The video device number that needs to be replaced with the accessory
-v /dev/bus/usb/00x/0xx:/dev/bus/usb/00x/0xx #Needs to be replaced with the actual queried USB device number
->Add it to the script after modification

ROS1 example: docker_ros1.sh

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 \
-v /home/pi/temp:/root/temp \
--device=/dev/xxx \
yahboomtechnology/ros-melodic:1.2 /bin/bash

ROS2 example: docker_ros2.sh

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 \
-v /home/pi/temp:/root/temp \
--device=/dev/xxx \
yahboomtechnology/ros2-foxy:2.0.1 /bin/bash

Annotated script (not run directly)

xxxxxxxxxx
#!/bin/bash
xhost + # xhost is used to support GUI display in docker
docker run -it \ # Interactively run the docker image
--net=host \ # Container network is set to host mode
--env="DISPLAY" \ # Turn on the display GUI interface
--env="QT_X11_NO_MITSHM=1" \ # Use X11 port 1 for display
-v /tmp/.X11-unix:/tmp/.X11-unix \ # Mapping display service node directory
--security-opt apparmor:unconfined \
-v /home/pi/temp:/root/temp \ # As a directory for the host and container to temporarily transfer files. Later, the corresponding function package of the accessories needs to be imported for use. The directory name can be modified by yourself.
-v /dev/bus/usb/00x/0xx:/dev/bus/usb/00x/0xx \ # Add host device to the container, here is the xxx device port
--device=/dev/videox \ # Add host device to the container, here is x
--device=/dev/xxx \ # Add the host device to the container, here is xxx. If you don’t add it, the corresponding peripherals will not be recognized after entering the container.
-p 9090:9090 \ # Open port
-p 8888:8888 \
yahboomtechnology/ros2-foxy:2.0.1 /bin/bash # Mirror version number

7.3.3 Run the script to enter the container

Note: It must be executed on the VNC of the host machine or on the screen. It cannot be executed on the terminal that remotely accesses the Raspberry Pi through SSH. Otherwise, the GUI image may not be displayed in the container.

(If entering via ssh, this is an error message)

image-20231215093131203

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/中文