All rapyuta.io docs are open source. See something that's wrong or unclear? Submit a pull request.
Make a contributionA ROS publisher is part of a ROS package. It is a public git repository, which is built into a running docker container on the fly when the package is being deployed. A ROS subscriber is also a part of the same ROS package. It is downloaded on a device and is launched when the package is deployed.
The tutorial will show you how to deploy a basic ROS package with a ROS publisher running on the cloud and a ROS subscriber running on a device such as Raspberry PI by using a cloud routed network. It also shows how to use dockercompose runtime on a device.
Device requirements
You should be familiar with the below tools:
15 minutes
Basic ROS publisher and subscriber
While onboarding the device, ensure that you have selected Use docker-compose as default runtime check box.
To create the Docker publisher subscriber package using the console, follow the steps:
Docker publisher subscriber
The package has two components: the talker running on the cloud and the listener running on the device.
In the Component Name box, enter a name for the component, , for example, talker
The name of a component must consist of alphabets [A-Z, a-z], digits [0-9], hyphen - and an underscore _ character. It must not begin with a digit.
For Component Runtime, click Cloud.
Ensure Is ROS Component is selected.
Ensure the ROS Version is Melodic.
Set the value of Replicas to run the component to the number 1 (default value).
In the Executable Name box, enter a name for the executable , for example,
talkerExecutable
The name of an executable must consist of alphabets [A-Z, a-z], digits[0-9], hyphen - and an underscore _ character, and must not start with a digit.
For the Docker Image value, enter: quay.io/rapyuta/io_tutorials
.
In the Command to run in the docker container box, enter the command:
roslaunch talker talker.launch
Ensure you always execute the command roslaunch to explicitly start the ROS Master instead of running the rosrun command, because the ROS Master will fail to start on rosrun, and eventually, the deployment will fail as well.
The talkerExecutable publishes a ROS topic, /telemetry
To add a ROS topic, click Add ROS topic. In the Name box, enter the name of the ROS topic. Select Maximum for QoS.
In the Component Name box, type in a name for the component, , for example, listener
The name of a component must consist of alphabets [A-Z, a-z], digits [0-9], hyphen - and an underscore _ character, and must not begin with a digit.
For Component Runtime, click Device.
Ensure Is ROS Component is selected.
Ensure the ROS Version is Melodic.
Select arm32v7 as Architecture.
In the Executable Name box, type in a name for the executable , for example,
listenerExecutable
The name of an executable must consist of alphabets [A-Z, a-z], digits [0-9], hyphen - and an underscore _ character, and must not begin with a digit.
For the Docker Image value, enter: quay.io/rapyuta/io_tutorials
.
In the Command to run in the docker container box, enter the command:
roslaunch listener listener.launch
Ensure you always execute the command roslaunch to explicitly start the ROS Master instead of running the rosrun command, because the ROS Master will fail to start on rosrun, and eventually, the deployment will fail as well.
Click NEXT > CONFIRM PACKAGE CREATION.
If you have already created a routed network, you can skip this procedure. For more information about routed network, click here
Perform the following procedure to create a routed network.
cloud_routed_network_1
as the name for the routed network.To deploy a package using the console, follow the steps:
Docker Publisher Subscriber Deployment
You will be redirected to the newly created deployment’s Details page where a green colored bar moves from In progress to Succeeded with Status: Running indicating that the DEPLOYMENT PHASE has Succeeded, and the STATUS is Running.
You may also analyze the corresponding deployment logs to check if everything is working OK.
The listener-listenerExecutable will be streaming /listener I heard hello_world logs.
while talker-talkerExecutable will be publishing hello_world logs.