All rapyuta.io docs are open source. See something that's wrong or unclear? Submit a pull request.Make a contribution
The Publisher for Configured Devices is a ROS package that will be deployed on a device, which is configured based on a set of parameters like name, location, velocity, etc.
The tutorial will show you how to apply configuration parameters to a device before deploying a rapyuta.io package on it.
You should be familiar with the configurations concept.
Read the quick starting guide on how to apply configurations to devices.
You should be familiar with the following tools:
The tutorial consists of the below steps:
You will define the configuration robots as follows:
On the left navigation bar, click Development>Configurations.
Click ADD NEW CONFIGURATION.
Provide a name, for example, robots for the configuration in the Configuration Name box.
Add a new file, name.yaml, below the root node robots.
Define parameters in the name.yaml.
For more information about configuration parameter, click here
Similarly, define parameters in all of the name.yaml files occurring below the various value nodes and the root node. For example,
The tutorial will use Raspberry PI as the device. Learn how to prepare the device.
If you are using the custom rapyuta.io image on the device, you need to execute the following command to update the io_tutorials repository at the root of your catkin workspace.
git pull https://github.com/rapyuta/io_tutorials
To build the package, run the below command at the root of your catkin workspace.
catkin build param_talker
When onboarding the device to rapyuta.io, the environment variable RIO_CONFIGS_DIR is set locally on the device. It is the location of the directory where all of the configurations that will be applied to the device are stored.
The value of RIO_CONFIGS_DIR is set to /opt/rapyuta/configs
RIO_CONFIGS_DIR is available to all the executables of a running deployment.
You should define labels for the device so you can apply configuration parameters to it. You will define the following labels in this tutorial:
To apply an existing configuration to the device:
The set of device labels (robot_type: drone, robot_name: drone-1) are resolved to select the drone-1/name.yaml file, and thus, apply the below configuration parameters:
name: first_name: Drone 1.0 last_name: RDrone
Had you given a device label, for example, robot_type: drone, rapyuta.io would traverse the configuration tree, select the drone/name.yaml file and apply the configuration parameters found in the file. Similarly, if no device label is defined, name.yaml file will be selected for the application of configuration parameters defined in the file.
You may apply more than one configuration to a single device.
The robots configuration is stored in RIO_CONFIGS_DIR and its parameters file name.yaml is stored in the robots (corresponding configuration) directory as shown in the figure below.
You can use RIO_CONFIGS_DIR in ROS launch files for loading configurations.
You can remotely access RIO_CONFIGS_DIR by SSH-ing into the device via rapyuta.io
To create the Publisher for Configured Devices package, follow the steps:
On the left navigation bar, click Development>Catalog.
Click ADD NEW PACKAGE.
Provide a name for the package, for example,
Publisher for Configured Devices in the Package Name box.
Make sure Is singleton package is not selected.
Ensure Is a bindable package is indeed selected.
In the Description box, provide a summary of the package, for example,
Demo package to illustrate configuration parameters concept
In the Component Name box, enter a name for the component, for example,
Select Device for Component Runtime.
Ensure Is ROS Component is selected.
Ensure the ROS Version is Melodic.
In the Executable Name box, enter a name for the executable, for example,
Select Default for Executable Type.
roslaunch param_talker talker.launch in the Command to run in the docker container box.
Click NEXT > CONFIRM PACKAGE CREATION.
To deploy the Publisher for Configured Devices package, follow the steps:
Configurations Publisherin the Name of deployment box.
You will be redirected to the newly created deployment’s Details page. The Configurations Publisher is successfully running when the green colored bar moves to Succeeded and Status: Running point indicating that the DEPLOYMENT PHASE is Succeeded and the STATUS is Running.
You may verify the correctness of the tutorial by analyzing the corresponding deployment logs by clicking on the Historical Logs.
The historical logs will display the output as shown:
hello Drone 1.0 RDrone
The output contains values of the first_name and last_name parameters for the drone-1 device.
Your output may be different based on the device labels you define.