You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before installing ROS2, you first need to install Docker on your Raspberry Pi 5. Docker is a containerization platform that allows running applications in isolated environments called containers.
Update your system
Ensure your system is up to date.
sudo apt-get update
sudo apt-get upgrade
Install Docker
Download and install Docker.
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
Add Permission to Pi User
Add the default pi user to the Docker group to run Docker commands without sudo.
sudo usermod -aG docker pi
Test Docker Installation
Verify that Docker is installed correctly by running the hello-world image.
docker run hello-world
Reboot
Reboot your Raspberry Pi to ensure all changes are applied.
sudo reboot
Install ROS2 inside Docker
Once Docker is installed, you can install ROS2 in a Docker container. Use the following command:
On the host machine, allow Docker to display GUI applications:
xhost +local:docker
or simply
xhost +
This command adds the local Docker container to the X server access control list, allowing GUI applications from the container to be displayed on the host machine's screen.
In the docker
export DISPLAY=:0
Run Rviz2 inside the Container
Once Rviz2 is installed, you can run it inside the container, and it will display on the host machine's screen.
Note: Remember to restrict xhost access after you are done, for security reasons:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Install ROS2 on Raspberry Pi 5
Install Docker on Raspberry Pi
Before installing ROS2, you first need to install Docker on your Raspberry Pi 5. Docker is a containerization platform that allows running applications in isolated environments called containers.
Update your system
Ensure your system is up to date.
Install Docker
Download and install Docker.
Add Permission to Pi User
Add the default
pi
user to the Docker group to run Docker commands withoutsudo
.Test Docker Installation
Verify that Docker is installed correctly by running the hello-world image.
Reboot
Reboot your Raspberry Pi to ensure all changes are applied.
Install ROS2 inside Docker
Once Docker is installed, you can install ROS2 in a Docker container. Use the following command:
This command creates a Docker container named
ros2_humble
with configurations such as:ros2dk
.ros:humble
image.Install Rviz2 & Configure Display
To use Rviz2 and other desktop applications like Rqt within the Docker container, follow these steps:
Access the Container
Install Rviz2 and Rqt
If not already installed in the
ros:humble
image, install them.Configure Display
On the host machine, allow Docker to display GUI applications:
or simply
This command adds the local Docker container to the X server access control list, allowing GUI applications from the container to be displayed on the host machine's screen.
In the docker
Run Rviz2 inside the Container
Once Rviz2 is installed, you can run it inside the container, and it will display on the host machine's screen.
Note: Remember to restrict
xhost
access after you are done, for security reasons:Beta Was this translation helpful? Give feedback.
All reactions