Deploy COS for robotics agent on your robot

Overview

Requirements: Before starting this tutorial, make sure to have the server side working from the previous tutorial

In order for a device to register and interact with the COS registration server and its application the following snaps have to be installed:

Verify connectivity

Before diving into the device setup, let’s ensure that the device can connect to the server. To connect devices across different networks a VPN between the robots and the server could be used but is not mandatory. Let’s do so by initiating a ping from the device to the server:

ping <cos-robotics-server-ip>

Make sure the above ping works in both directions, otherwise the rest of the guide cannot be executed. Now it’s time to set up and register the device!

Installation

A convenience script has been created to install all the required snaps on the device. Download the script as follows:

curl -L https://raw.githubusercontent.com/canonical/rob-cos-device-setup/main/setup-robcos-device.sh -O

And run it with:

sudo bash setup-robcos-device.sh

The script will initiate prompts for the robot UID and the rob-cos-server URL. While the robot UID is optional, the URL is mandatory, serving as the designated address for the rob-cos server where the device registration occurs. The queries and response will look as follows:

Please enter the device-uid:
robot_1

Please enter the rob-cos-server-url: http://<cos-robotics-server-ip>/cos-robotics-model

The script will now proceed with the installation of all the required snaps. Upon completion, the device and its corresponding dashboards will be registered and available for visualization on the COS for robotics server.

Verify Installation

Now let’s verify that the device has been correctly configured and registered. On the browser, access the catalogue and click on the COS-registration-server app. The registered robot should be now available in the devices list:

image

By clicking on the robot UID, a page will open, displaying all the links to the robot’s data:

image

From this page, each link will redirect you to the corresponding dashboard for the specific data category and device, ensuring easy and intuitive visualization.

An example visualization of Grafana linux-system dashboard is provided below:

image

The Bag Files link will redirect you to the list of bag files, which can be selected and copied into Foxglove Studio for visualization and analysis. The bag files will look as follows:

image

Note: by default the ros2bag file recording is enabled, so the agent will start pushing bags to the server. At first, it is recommended to disable the service to avoid filling up the server disk. To do so, run the following command:

sudo snap stop ros2-exporter-agent.recorder

The service can then be enabled with:

sudo snap start ros2-exporter-agent.recorder

This is it, now your device is registered and being correctly monitored via COS for robotics!