Turtlesim

Turtlesim is a tool made for teaching ROS and ROS packages. This tutorial will show you how to set up and run a variation of the ROS Turtlesim on the cloud using rapyuta.io.

To attain a deeper understanding of rapyuta.io, it is highly recommended that the developer refer to the following sections in the documentation

Learning objectives

The tutorial will show you how to deploy a basic Turtlesim ROS package on the cloud. The steps mentioned here would help you

  • Create a routed network for ROS Communication
  • Understand packages and how they can be added to your account.
  • Deploy packages to the cloud
  • Access network endpoints of the cloud deployment
  • Bonus: ROS communication using across deployments and a common routed network

The tutorial will also have a few optional and exploratory steps covering

  • Recording ROS Bag jobs on running deployments
  • Remote SSH for accessing deployments
  • Accessing logs of deployments

Estimated Time

15 - 30 minutes

Difficulty

Beginner

Prerequisites

  1. Ensure that the Google Chrome browser is installed on the computer.
  2. You should have your account setup completed and have 1 Project created.
  3. You should be familiar with the below tools:
  4. UNIX/LINUX command terminal
  5. ROS topics
  6. ROS services

Step 1: Create a Routed Network

rapyuta.io offers seamless communication between different ROS nodes running on the cloud or a device. This automatic communication reduces the need to manage shared ROS masters and allows you to focus on building your robotics solution.

Let’s begin by creating a melodic-cloud-rnet routed network.

  1. On the left navigation menu, click Networking > Networks.
  2. Click Add Network and select Routed Networks.
  3. In the Create new routed network dialog-box, enter the following details in the respective fields.
    • Name : Type melodic-cloud-rnet as the name of the routed network.
    • ROS Distro: From the drop-down menu, select the ROS distro as Melodic.
    • Runtime: Select the runtime as Cloud.
    • Resource Limit: Select the resource limit as Small: 1cpu core, 4Gib memory.
  4. Click Continue.

Your new network would now be provisioned in a few minutes.

💡 Understand: Routed Networks

Step 2: Import Packages

Software is distributed on rapyuta.io’s cloud platform using Packages.

We will begin with importing the TurtleSim packages into your account.

  1. Import Turtle-World package into your account Import Package

If you want to create your own packages, refer to the how to guide and deep dives on Packages.

💡 Understand : Packages

Step 3: Deploy Packages

Deployments are instances of running packages. Begin by deploying the Turtle-World package.

  1. On the left navigation menu, click Development > Package
  2. Click the package Turtle-World, and click Deploy package.
  3. In the Name of deployment field, type turtlesim-cloud.
  4. Optionally, to add a new ROS bag job to the deployment, click Add ROS bag Job. In the Name field, type rosbag-all and select All Topics to record.
  5. From the Routed Network drop-down menu, select melodic-cloud-rnet.
  6. Click Create Deployment to proceed.

The deployment should now start running in the cloud. This usually takes a few minutes. You would be taken to the detail page of the deployment where the progress of the provisioning can be seen.

When the deployment is running its status should show up as Succeeded with a green dot next to it.

Step 4: Explore Turtle World

Congratulations! You have your first deployment running on rapyuta.io.

Open the TURTLESIM_WEB endpoint to access turtlesim world web UI in a new browser tab.

  • Try moving the Turtle around using the command interface.
  • If the Turtle behaves as you expect, you have successfully finished the basic tutorial.

Additionally, you can also,

  1. Open the JUPYTER endpoint to access the notebook server.
    • Jupyter server has been configured with the python 2 kernel and has python-ros packages installed.
    • Try moving the turtle programmatically
  2. Open the VNC endpoint to access a complete desktop environment

💡 Endpoints can be found on the Deployment Detail Page. They are of the format http://inst-xxxxxxxx:80 , https://inst-xxxxxxx:443

Bonus : Tools & Debugging

Remote SSH

rapyuta.io allows you to access running deployment over a web SSH terminal right from your browser.

  1. Go to Development > Deployment
  2. Click on the deployment you created above: turtlesim-cloud
  3. Click on Shell Access
  4. Click SSH on the turtlesim component.

Remote SSH helps you in debugging deployments that are running on the platform but don’t come bundled with remote-debugging tools like webVNC or notebook servers.

Logs

rapyuta.io captures and stores terminal output for your running deployments. You can access both the live-logs of a running deployment as well as the historical logs of a deployment that is running or has been stopped recently. Historical logs of deployment are retained for 7 days or more as per your subscription plan.

To access logs for turtlesim-cloud

  1. Go to Development > Deployment
  2. Click on the deployment you created above: turtlesim-cloud
  3. Click on either Live Logs or Historical Logs to see the output generated by the deployment.

Read more about logs here

ROS Bag

rapyuta.io can record rosbags on your running deployments.

Recording jobs added at the time of deployment creation start and stop with the deployment. You can additionally start new ROS bag jobs on any running deployment. You can also stop any ROS bag job manually while a deployment is still running.

Ros bag jobs upload the recorded bags to Cloud storage and these bags are available for easy access and archiving even after your deployment stops running.

To access ROS bags recorded on our deployment

  1. Go to Development > Deployment
  2. Click on the deployment you created above : turtlesim-cloud
  3. Click on ROS Bag jobs
  4. Click on Stop to stop a running job
  5. In a few minutes, ROS bag job will go from Stopping to Stopped
  6. Rosbags uploaded to cloud storage will appear under Collected Bags

Read more about Rosbags on rapyuta.io here

Bonus: More Turtles

We will now add another turtle into the sim world.

To do this, import and deploy the Turtle Melodic package over the same routed network as Turtle-World

  1. Import Turtle Melodic pacakge into your account Import Package
  2. Once the package is imported, you would be automatically taken to the package detail page
  3. On the detail page, press Deploy package.
  4. Enter the following details in the respective fields.
    • Name of deployment: turtle-1
    • Routed Network: Press Add and select melodic-cloud-rnet from the network drop-down menu.
  5. Click Create Deployment to proceed.

The second turtle should now show up in the Web-UI.

You can deploy more Turtles if you want. You can now command two turtles simultaneously.

Cleanup

💡 Deployments consume cloud resources that are chargeable beyond your free-tier usage limit. It is advised to deprovision deployments when not in use.

To deprovision (stop) a running deployment, follow the steps:

  1. Go to Development > Deployments
  2. Click Deprovision against the running deployment that you want to stop.
  3. Deployment is successfully deprovisioned when you get a DEPLOYMENT STOPPED message and the corresponding deployment status read Stopped.
  4. Repeat these steps for any deployment you may have created but aren’t using anymore.