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.
If the device has ROS Melodic Morenia installed on it, replace Kinetic with Melodic in all places where a specific version of ROS is asked for. The tutorial should still work the same.
The tutorial consists of the below steps:
You will define the configuration robots as follows:
Refer to the quick starting guide on how to define parameters.
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 say 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:
Publisher for Configured Devicesin the Package Name box.
Demo package to illustrate configuration parameters concept
roslaunch param_talker talker.launch
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.