Difference between revisions of "Advantech Robotic Suite/Container"

From ESS-WIKI
Jump to: navigation, search
Line 30: Line 30:
 
| style="padding: 5px;" |  
 
| style="padding: 5px;" |  
 
|-
 
|-
| style="padding: 5px; text-align: center;" | dev-ros2-foxy
+
| style="padding: 5px; text-align: center;" | [[Advantech Robotic Suite/Container/Develop_ROS_Container|dev-ros2-foxy]]
 
| style="padding: 5px;" | This container provides a pre-configured ROS2 Foxy environment along with examples for subscribing to and controlling ros2 nodes in '''edge-ros2-foxy'''.
 
| style="padding: 5px;" | This container provides a pre-configured ROS2 Foxy environment along with examples for subscribing to and controlling ros2 nodes in '''edge-ros2-foxy'''.
 
| style="padding: 5px;" | Request:<ul style="margin: 0; padding-left: 15px;">
 
| style="padding: 5px;" | Request:<ul style="margin: 0; padding-left: 15px;">
Line 37: Line 37:
 
</ul>
 
</ul>
 
|-
 
|-
| style="padding: 5px; text-align: center;" | dev-ros2-humble
+
| style="padding: 5px; text-align: center;" | [[Advantech Robotic Suite/Container/Develop_ROS_Container|dev-ros2-humble]]
 
| style="padding: 5px;" | This container provides a pre-configured ROS2 Humble environment along with examples for subscribing to and controlling ros2 nodes in '''edge-ros2-humble'''.
 
| style="padding: 5px;" | This container provides a pre-configured ROS2 Humble environment along with examples for subscribing to and controlling ros2 nodes in '''edge-ros2-humble'''.
 
| style="padding: 5px;" | Request:<ul style="margin: 0; padding-left: 15px;">
 
| style="padding: 5px;" | Request:<ul style="margin: 0; padding-left: 15px;">
Line 45: Line 45:
 
</ul>
 
</ul>
 
|-
 
|-
| style="padding: 5px; text-align: center;" | util-ros2-humble
+
| style="padding: 5px; text-align: center;" | [[Advantech Robotic Suite/Container/Utility ROS Container|util-ros2-humble]]
 
| style="padding: 5px;" | This container is a ready-to-use ROS2 toolkit with rviz, rqt, cartographer, nav2, and moveit. It's great for building robots quickly.
 
| style="padding: 5px;" | This container is a ready-to-use ROS2 toolkit with rviz, rqt, cartographer, nav2, and moveit. It's great for building robots quickly.
 
| style="padding: 5px;" | Request:<ul style="margin: 0; padding-left: 15px;">
 
| style="padding: 5px;" | Request:<ul style="margin: 0; padding-left: 15px;">
Line 83: Line 83:
 
</ul>
 
</ul>
 
|}
 
|}
 
= Develop ROS Container =
 
 
Develop ROS container image that assists developers in building its own ROS containerized applications.
 
 
== How To ==
 
 
=== Start docker container ===
 
 
'''Step1: Launch the docker container of dev-ros2-foxy'''
 
<syntaxhighlight lang="bash">
 
$ cd /usr/local/Advantech/ros/container/docker
 
$ ./launch.sh dev-ros2-foxy
 
</syntaxhighlight>
 
 
'''Step2: Accessing the container for development and debugging'''
 
<syntaxhighlight lang="bash">
 
$ docker exec -it dev-ros2-foxy bash
 
</syntaxhighlight>
 
 
&nbsp;
 
 
=== Examples ===
 
 
Examples demonstration&nbsp;on how to subscribe to and control services of other ROS2 nodes.
 
 
*'''[[Advantech_Robotic_Suite/Sample_Node#c.2B.2B_sample|C++ sample]]'''
 
*'''[[Advantech_Robotic_Suite/Sample_Node#rclnodejs_sample|rclnodejs sample]]'''
 
*'''[[Advantech_Robotic_Suite/Sample_Node#rclpy_sample|rclpy sample]]'''
 
*'''[[Advantech_Robotic_Suite/SUSI_Node|SUSI Node]]'''
 
*'''[[Advantech_Robotic_Suite/Modbus-Master_Node|Modbus-Master Node]]'''
 
*'''[[Advantech_Robotic_Suite/OPCUAClient_Node|OPCUAClient Node]]'''<br/> &nbsp;
 
 
=== Stop docker container ===
 
 
<syntaxhighlight lang="bash">
 
$ cd /usr/local/Advantech/ros/container/docker
 
$ ./stop.sh dev-ros2-foxy
 
</syntaxhighlight>
 
 
&nbsp;
 
 
== Build Your Docker Container ==
 
 
To build a Docker container for your ROS2 application and integrate Advantech's add-ons services, you can following the steps.
 
 
=== Step1: Define a Dockerfile ===
 
 
Create a file called "Dockerfile" that specifies the instructions for building the container based on '''dev-ros2-foxy'''. This file includes details such as the base image, dependencies, environment variables, and commands to run inside the container.
 
<pre>FROM advigw/dev-ros2-foxy:1.0.0
 
 
# 1. Copy prerequisites of your application into the container
 
# WORKDIR /root
 
# COPY prerequisite/<your_application> /root/prerequisite
 
 
# 2. Install dependencies or libraries
 
# RUN apt-get update
 
# RUN apt-get install <some_dependency>
 
 
# 3. Execute your application automatically upon container startup.
 
# CMD [<application_command>]
 
</pre>
 
 
=== Step2: Build the Docker image ===
 
 
Use the Docker command-line to build the Docker image based on the Dockerfile. This process involves pulling the necessary base image, executing the instructions in the Dockerfile, and creating a layered image with all the specified components.
 
<syntaxhighlight lang="bash">
 
$ docker build -t ros-example -f Dockerfile .
 
</syntaxhighlight>
 
 
=== Step3: Define the Docker Compose services ===
 
 
Create a file called "docker-compose.yml", in the Docker Compose file, define the services, their image references, and any necessary configurations such as environment variables, port mappings, volume bindings, etc. Use the syntax provided by Docker Compose to define each service.
 
<pre>version: '2.0'
 
 
services:
 
  ros-example:
 
    image: ros-example
 
    container_name: ros-example
 
    restart: always
 
    networks:
 
    - adv-ros-network
 
    logging:
 
      options:
 
      max-size: 10M
 
    environment:
 
    - ROS_DOMAIN_ID=${ROS_DOMAIN_ID}
 
 
networks:
 
  adv-ros-network:
 
    name: adv-ros-network
 
</pre>
 
 
=== Step4: Start the containers using Docker Compose ===
 
 
Execute the docker-compose up command in the directory where the Docker Compose file is located. This command will start the containers as defined in the Compose file.<br/> <span style="color:red;">Note: When using the docker-compose command, please avoid using 'sudo' if you need to use the ROS_DOMAIN_ID environment variable. Otherwise, the variable may not be found during execution.</span>
 
<syntaxhighlight lang="bash">
 
$ docker-compose -f docker-compose.yml up -d
 
</syntaxhighlight>
 
 
=== Step5: Test and validate ===
 
 
Open a new interactive bash shell within the container.
 
<syntaxhighlight lang="bash">
 
$ docker exec -it ros-example bash
 
</syntaxhighlight>
 
 
Then test [[#Examples|ROS2 Example]] and your applications in container.
 
 
= 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'''<br>
 
If the container has been launched before, you can skip this step.
 
<syntaxhighlight lang="bash">
 
$ cd /usr/local/Advantech/ros/container/docker
 
$ ./launch.sh util-ros2-humble
 
</syntaxhighlight>
 
 
'''Step2: Accessing the container'''
 
<syntaxhighlight lang="bash">
 
$ docker exec -it util-ros2-humble bash
 
</syntaxhighlight>
 
 
'''Step3: Launch rviz2'''
 
<syntaxhighlight lang="bash">
 
$ rviz2
 
</syntaxhighlight>
 
[[File:ROS2 rviz.png|500px|ROS2 RViz]]<span style="color:#FF0000;">&nbsp;</span>
 
 
=== Launch RQT ===
 
 
'''Step1: Launch the docker container of util-ros2-humble'''<br>
 
If the container has been launched before, you can skip this step.
 
<syntaxhighlight lang="bash">
 
$ cd /usr/local/Advantech/ros/container/docker
 
$ ./launch.sh util-ros2-humble
 
</syntaxhighlight>
 
 
'''Step2: Accessing the container'''
 
<syntaxhighlight lang="bash">
 
$ docker exec -it util-ros2-humble bash
 
</syntaxhighlight>
 
 
'''Step3: Launch rviz2'''
 
<syntaxhighlight lang="bash">
 
$ rqt
 
</syntaxhighlight>
 
[[File:ROS2 Suite SW rqt graph.png|500px|ROS2 rqt graph]]
 
 
=== Launch Cartographer ===
 
 
'''Step1: Launch the docker container of util-ros2-humble'''<br>
 
If the container has been launched before, you can skip this step.
 
<syntaxhighlight lang="bash">
 
$ cd /usr/local/Advantech/ros/container/docker
 
$ ./launch.sh util-ros2-humble
 
</syntaxhighlight>
 
 
'''Step2: Accessing the container'''
 
<syntaxhighlight lang="bash">
 
$ docker exec -it util-ros2-humble bash
 
</syntaxhighlight>
 
 
'''Step3: Launch Cartographer'''<br>
 
Please refer to [https://ros2-industrial-workshop.readthedocs.io/en/latest/_source/navigation/ROS2-Cartographer.html ROS2-Cartographer] for usage instructions.
 
 
=== Launch Nav2 ===
 
 
'''Step1: Launch the docker container of util-ros2-humble'''<br>
 
If the container has been launched before, you can skip this step.
 
<syntaxhighlight lang="bash">
 
$ cd /usr/local/Advantech/ros/container/docker
 
$ ./launch.sh util-ros2-humble
 
</syntaxhighlight>
 
 
'''Step2: Accessing the container'''
 
<syntaxhighlight lang="bash">
 
$ docker exec -it util-ros2-humble bash
 
</syntaxhighlight>
 
 
'''Step3: Launch Nav2'''<br>
 
Please refer to [https://docs.nav2.org/tutorials/index.html ROS2-Navigation2] for usage instructions.
 
 
=== Launch MoveIt ===
 
 
'''Step1: Launch the docker container of util-ros2-humble'''<br>
 
If the container has been launched before, you can skip this step.
 
<syntaxhighlight lang="bash">
 
$ cd /usr/local/Advantech/ros/container/docker
 
$ ./launch.sh util-ros2-humble
 
</syntaxhighlight>
 
 
'''Step2: Accessing the container'''
 
<syntaxhighlight lang="bash">
 
$ docker exec -it util-ros2-humble bash
 
</syntaxhighlight>
 
 
'''Step3: Launch MoveIt'''<br>
 
Please refer to [https://moveit.picknik.ai/main/doc/tutorials/tutorials.html ROS2-MoveIt] for usage instructions.
 
 
&nbsp;
 

Revision as of 08:00, 29 November 2024

Introduction

  ROS applications may rely on specific ROS distribution, software versions, libraries, and configurations. Using containers ensures consistent application behavior across different environments, as the container encapsulates the required dependencies and environment settings, independent of the host system.
Advantech Robotic Suite offers Docker Container framework for simplifies the development, deployment, and management of ROS systems.

 

Advantech Robotic Suite container framework provides the following benefits:

  • Portability: Containers are portable units that can run on different systems and platforms, be it in development, testing, or production environments. This makes it easier to deploy and share ROS applications across different machines and environments.
  • Isolation: Containers provide an isolated environment, separating ROS applications from the host system and other containers. This helps prevent conflicts and interference between different applications, enhancing system stability and reliability.
  • Reproducibility: Containers ensure that the runtime environment of an application remains consistent across different deployments and executions, ensuring reproducibility. This is valuable for developers, testers, and operators, as they can reproduce and debug issues in different environments.
  • Scalability: Container technology offers scalability, allowing for quick replication and scaling of container instances based on demand. This makes it easier to add new nodes, services, or topics to the ROS system and dynamically adjust the number of containers based on the workload.

 

List of Advantech Robotic Suite Containers:

Docker Container Content Note
edge-ros2-foxy Advantech add-ons services includes SUSI Node, Modbus-Master Node, OPCUAClient Node and ROS2 bag database based on ROS2 Foxy.   
dev-ros2-foxy This container provides a pre-configured ROS2 Foxy environment along with examples for subscribing to and controlling ros2 nodes in edge-ros2-foxy. Request:
  • Advantech Robotic Suite 1.3.0 or higher
  • x86 architecture only
dev-ros2-humble This container provides a pre-configured ROS2 Humble environment along with examples for subscribing to and controlling ros2 nodes in edge-ros2-humble. Request:
  • Advantech Robotic Suite 1.5.0 or higher
  • x86 architecture only
  • Support for Ubuntu 24.04 only
util-ros2-humble This container is a ready-to-use ROS2 toolkit with rviz, rqt, cartographer, nav2, and moveit. It's great for building robots quickly. Request:
  • Advantech Robotic Suite 1.5.0 or higher
  • x86 architecture only
  • Support for Ubuntu 24.04 only

List of Advantech Robotic Suite Extension Containers:

Docker Container Content Note
usbcam-ros2-humble This container includes a pre-configured ROS node for USB cameras, allowing easy integration of video streams into ROS2 as messages. Request:
  • Advantech Robotic Suite 1.5.0 or higher
  • x86 architecture only
realsense-ros2-humble This container provides a ready-to-use ROS node for Intel RealSense cameras, simplifying the conversion of depth, color, and point cloud data into ROS2 messages. Request:
  • Advantech Robotic Suite 1.5.0 or higher
  • x86 architecture only
openvino_object_detection-ros2-humble This container demonstrates Intel OpenVINO's object detection in ROS2, enabling real-time detection using image topics or physical cameras, making it suitable for computer vision applications. Request:
  • Advantech Robotic Suite 1.5.0 or higher
  • x86 architecture only