Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the detailed steps for docker to install ros2

Shulou Source: shulou.com Published: 2022-06-02 08:14:03 10月02日 Update

This article will explain in detail what are the detailed steps for docker to install ros2. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Main topic

When it comes to today's topics docker and ros2, this article aims to solve three problems:

How to install dockerdocker on ubuntu, how to install ros2, how to visualize turtles in docker

Install docker on ubuntu

This is very simple, done in a word.

Sudo apt install docker.io

2. Install ROS2-Foxy in Docker

Actually, installation is out of the question. Here, we directly pull the official image of ROS2.

Sudo docker pull osrf/ros:foxy-desktop

After pulling, you can enter the installed image by using the following command

Sudo docker run-it osrf/ros:foxy-desktop

Then enter ros2 in the terminal

At this point, you have finished running ros2 images in docker. Is it fast and completely isolated from your computer? you can generate multiple images with one command, and even rosdep is good for init and update.

3. ROS2 docker visualization runs Little Tortoise

Install and start the mobaxterm remote tool

Make sure you and your computer with docker are in a local area network.

Notice the display here, and then we set the value of the environment variable of the DISPLAY mirrored by ros2 in docker

Export DISPLAY=192.168.0.112:0.0

Then you can start the little turtle simulator to have a look.

Ros2 run turtlesim turtlesim_node

Then you will find a magical scene in which the interface of the little turtle pops up on your windows computer.

Then run the keyboard control node

Ros2 run turtlesim turtle_teleop_key

Press the button and the little turtle runs.

On the docker installation of ros2 detailed steps are shared here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Tortoise mirror article computer run step content more topic knowledge article installed visual good magic one sentence one line three variables commands Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux vpn Apple Redmi MariaDB