Skip to content

ROS 2 - Develop within the onboard user container

The internal Linux computer of the Origin One, powered by an Nvidia Jetson Orin NX, runs Avular's proprietary CreOS, which is based on Linux for Tegra. This environment is carefully configured to ensure optimal performance and stability. Therefore, it is highly recommended not to make any changes to the CreOS environment, except for those explicitly mentioned in the online user manual. Unauthorized modifications can conflict with the pre-installed software and may result in unexpected behavior of the robot.

The internal Linux computer hosts several Docker containers that encapsulate most of the functionalities of the Origin One platform. The number of containers running on the system depends on the specific configuration of the Origin One that you have purchased.

By default, a user container is deployed on the Origin One, providing a dedicated environment for users to start interacting with the ROS 2 network of the robot. This user container serves as a sandbox where you can develop and test your applications without affecting the core system. It is an ideal starting point for extending the capabilities of the Origin One while maintaining the integrity of the underlying system. In order to work with the user Docker containers, you require an SSH connection to the Origin One, either over Wi-Fi or via the onboard ethernet port.

Info

When the Origin One configured with an Autopilot package, it is not recommended to develop on the internal Linux computer with a user container. Computing resources are required by the Autopilot to fulfill it's functionalities, extra computational load from user containers will interfere with the performance of the Autopilot behavior.

Interact with ROS from inside the User container environment

Once you have connected to the device, you can start interacting with the ROS 2 network. ROS 2 is not installed on the base OS (CreOS) of the Linux computer (Jetson), so you will not be able to interact with the ROS 2 network yet. To do so, you will need to be in an environment that has ROS 2 installed. The containers running on the Origin have ROS 2 installed, so you can use those to interact with the ROS 2 network. The installed version of the ROS 2 distribution is Humble.

The Origin One comes with a preinstalled and running user Docker container environment. This Docker container can be used by the user to interact with the ROS 2 network of the Origin One. Primarily for checking signals and debugging. Information on the user container that is by default deployed on the Origin One, please consult first the public User container repository

To enter a container, you can use the following command:

docker exec -it <container_name> /bin/bash

In case of the standard deployed user container the <container_name> is user. Enter the container by running:

docker exec -it user /bin/bash

You're now inside the user container, you can now interact with the ROS 2 network.

ros2 topic list

To exit the container simply run:

exit

The files for the standard user container are located in /data/user/containers. Essentially the folder /data/user is for you to develop on and can create other docker container folders.

You can also run your own container with ROS 2 installed, and interact with the ROS 2 network from there. You can follow the example from the user container repository. It is important to note that the robots internal ROS 2 network runs using ROS Humble and the CycloneDDS middleware. CycloneDDS is not the default middleware for ROS 2, so you will need to make sure the package ros-humble-rmw-cyclonedds-cpp is installed in your own container as well, and setting the environment variable RMW_IMPLEMENTATION: rmw_cyclonedds_cpp.

Development with user containers

It is recommended to use VSCode Remote SSH and VSCode Dev Containers for development on the Origin One robot using user containers.

  • An example on how to use Remote SSH is shown in the following Youtube video

    For Remote SSH development it is recommended to connect your personal computer to the Origin One access point or ethernet port for minimal latency and connect the Origin One to a local third party Wi-Fi network to access the internet for downloading images, cloning Github repo's, et cetera. Note: the Origin One is equipped with Dual Wi-Fi, so it can be connected to a local Wi-Fi network and enable a Wi-Fi access point simultaneously.

  • An example on how to use Dev Containers is shown in the following Youtube video

    For example, the standard user container can be configured using Dev Containers. First start by creating a folder .devcontainer inside the user container directory.

    cd /data/user/containers
    mkdir .devcontainer
    
    Now, create a devcontainer.json file that can be used with the user container:
    cd .devcontainer
    nano devcontainer.json
    
    Now the nano text-editor creates and opens the file. Paste the following inside the file using ctrl + shift + v:
    // For format details, see https://aka.ms/devcontainer.json. For config options, see the
    // README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
    {
    "name": "User Container",
    // Use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
    "dockerComposeFile": "../docker-compose.yml",
    "service": "user-container",
    "workspaceFolder": "/home/user/ws",
    }
    
    Exit the file with ctrl + x and press enter when prompted to save the file.
    You can now launch the Dev Container as illustrated in the Youtube video.

Environment variables

The environment variables that are configured in every container are an important part of the configuration. Below is a list of the environment variables that are used in the containers. The variables are divided into two categories: variables that are used in every container and variables that are only used in specific containers.

Variables used in every container

Variable Description
ROS_DOMAIN_ID A unique identifier of the ROS network. This should be a unique number for the robot, and should be exactly the same in every container running on the robot. If a container's ROS_DOMAIN_ID variable differs it will not be able to communicate with the other containers.
CYCLONEDDS_URI The path to the cyclone DDS configuration. This configuration will make the DDS reliable on the robot.
RMW_IMPLEMENTATION The RMW implementation that is used by the ROS2 nodes. This should be set to rmw_cyclonedds_cpp for the cyclone DDS implementation.