Lesson 7 Installation ROS in Docker
Lesson 7 Installation ROS in Docker
Note: Our Raspberry Pi image is already installed with ROS1 or ROS2 environment
when you receive the package. This section is provided for learning and reference only.
1. ROS1 Installation
4) Enter “docker ps -a” in the terminal to check the ID of the newly created
container.
1
5) Enter “docker exec -it 75b6634e6227 /bin/bash” in the terminal to
access the container.
8) Enter “usermod -aG sudo ubuntu” in the terminal. Add “sudo” to the
new user “ubuntu” to give it superuser privileges.
9) Enter “sudo apt-get update -y && sudo apt-get upgrade -y” in the
terminal to update the available software package list and upgrade the
installed package on the system.
10) Enter “sudo apt-get install vim -y” in the terminal to install the “Vim”
text editor.
2
11) Enter “sudo apt-get install ros-melodic-desktop-full -y” in the terminal
to install the complete desktop environment of the “ROS Melodic” version. The
downloading takes time, please wait for a while with the patient.
3) Every time you open the terminal, execute step 2 to load the working
space. Enter the “echo “source /opt/ros/melodic/setup.bash” >> ~/.bashrc”
command and write it into the “.bashrc” file.
4) Then enter the “source ~/.bashrc” command to take the “.bashrc” file
into effect. This action frees you from loading the working space environment
3
every time opening the terminal.
2. ROS2 Installation
4) Enter “docker ps -a” in the terminal to check the ID of the newly created
container.
8) Enter “usermod -aG sudo ubuntu” in the terminal. Add “sudo” to the
new user “ubuntu” to give it superuser privileges.
5
9) Enter “sudo apt-get update -y && sudo apt-get upgrade -y” in the
terminal to update the available software package list and upgrade the
installed package on the system.
10) Enter “sudo apt-get install vim -y” in the terminal to install the “Vim”
text editor.
6
2) Enter the “source /opt/ros/humble/setup.bash” command to manually
configure the ROS2 environment.
3) Every time you open the terminal, execute step 2 above to load the
working space. Enter the “echo “source /opt/ros/humble/setup.bash” >>
~/.bashrc” command and write it into the “.bashrc” file.
4) Then enter the “source ~/.bashrc” command to take the “.bashrc” file
into effect. This action frees you from loading the working space environment
every time opening the terminal.
7
8