Advantech Robotic Suite/Container/Utility ROS Container

From ESS-WIKI
Jump to: navigation, search

Utility ROS Container

The Utility ROS Container image integrates various commonly used tools and utilities for ROS2 users, including RViz2, RQT, Cartographer, Nav2, and MoveIt. This container enables users to quickly access and utilize these features.

How To

Launch RViz2

Step1: Launch the docker container of util-ros2-humble
If the container has been launched before, you can skip this step.

$ cd /usr/local/Advantech/ros/container/docker
$ ./launch.sh util-ros2-humble

Step2: Accessing the container

$ docker exec -it util-ros2-humble bash

Step3: Launch rviz2

$ rviz2

ROS2 RViz 

Note
If you want to import a custom RViz2 layout configuration file, you can place the configuration file in '/usr/local/Advantech/ros/container/share/rviz2/default.rviz', then manually overwrite the configuration file inside the container.

$ docker exec -it util-ros2-humble bash
$ cp /usr/local/Advantech/ros/container/share/rviz2/default.rviz /root/.rviz2/default.rviz

Launch RQT

Step1: Launch the docker container of util-ros2-humble
If the container has been launched before, you can skip this step.

$ cd /usr/local/Advantech/ros/container/docker
$ ./launch.sh util-ros2-humble

Step2: Accessing the container

$ docker exec -it util-ros2-humble bash

Step3: Launch rqt

$ rqt

ROS2 rqt graph

Launch Cartographer

Step1: Launch the docker container of util-ros2-humble
If the container has been launched before, you can skip this step.

$ cd /usr/local/Advantech/ros/container/docker
$ ./launch.sh util-ros2-humble

Step2: Accessing the container

$ docker exec -it util-ros2-humble bash

Step3: Launch Cartographer
Please refer to ROS2-Cartographer for usage instructions, or use Advantech's quick Cartographer example.

Launch Nav2

Step1: Launch the docker container of util-ros2-humble
If the container has been launched before, you can skip this step.

$ cd /usr/local/Advantech/ros/container/docker
$ ./launch.sh util-ros2-humble

Step2: Accessing the container

$ docker exec -it util-ros2-humble bash

Step3: Launch Nav2
Please refer to ROS2-Navigation2 for usage instructions.

Note
If you want to import a custom Nav2 configuration file, you can place the configuration file in '/usr/local/Advantech/ros/container/share/nav2/nav2_params.yaml', then manually overwrite the configuration file inside the container.

$ docker exec -it util-ros2-humble bash
$ cp nav2_params.yaml /opt/ros/humble/share/nav2_bringup/params/nav2_params.yaml

Launch MoveIt

Step1: Launch the docker container of util-ros2-humble
If the container has been launched before, you can skip this step.

$ cd /usr/local/Advantech/ros/container/docker
$ ./launch.sh util-ros2-humble

Step2: Accessing the container

$ docker exec -it util-ros2-humble bash

Step3: Launch MoveIt
Please refer to ROS2-MoveIt for usage instructions.

Note

When starting a GUI application inside a container, you might encounter rendering issues. A common cause is an incorrectly set DISPLAY environment variable for X11. There are the following methods to fix this:

1. Allow access to the user's X server from the local network.
Open a terminal to run the command.

$ xhost +local:

2. Set a specific DISPLAY environment variable in docker-compose.

$ vim /usr/local/Advantech/ros/container/docker/docker-compose/util-ros2-humble/docker-compose.yml

Then remove the old container and launch a new one. Remember to backup your data and configuration files in container.

$ docker rm -f util-ros2-humble
$ cd /usr/local/Advantech/ros/container/docker
$ ./launch.sh util-ros2-humble

ROS2 Suite docker compose display setting