The walkthrough demonstrates a navigation application that controls
turtlebot3 in a Gazebo simulation on rapyuta.io
It shows the separation of launch files into application and simulation.
It is recommended to run the simulation on the cloud and the
application on either a computer or an instance of the cloud.
Familiarity with tools like git, UNIX/LINUX command terminal.
Optional: ROS launch system concepts and ROS navigation stack structure are suggested readings if you want to run your applications with Gazebo on rapyuta.io. It will help you understand the usage better.
Difficulty
Intermediate
Estimated Time
25 minutes
Background
The source code for the walkthrough is in the
turtlebot_navigation repository on GitHub.
The simulation and navigation application start from separate
launch files so that the former runs on the cloud and the
latter runs on a device.
The package, io_gazebo_turtlebot_bringup, includes files
that start a demo application for navigating a turtlebot3 model
in a Gazebo simulation. These files are:
common.launch
load configuration parameters shared between
simulation and navigation application to respective ROS parameter
servers, for example, robot_description, an initial position
of the TurtleBot.
app.launch
launches amcl, move_base and other navigation related nodes through io_gazebo_turtlebot_navigation.launch
launches demo application that sends sequential move_base goals through demo_app.launch
loads common configuration parameters via common.launch
sim.launch
loads Gazebo simulation of turtlebot3 via
io_gazebo_turtlebot_gazebo.launch file.
loads common configuration parameters via common.launch
On the device’s command line terminal, execute the following commands
in sequence to set up a catkin workspace, install ROS dependencies
and build the catkin workspace.
On the left navigation bar, click Devices>All Devices.
Click ADD NEW DEVICE.
The name of the device is Turtlebot3 Navigation Simulation Device.
Provide the absolute path of the catkin workspace in the ROS Catkin Workspace box. In this case, the workspace is /home/rapyuta/catkin_ws. The absolute path of your catkin workspace may be different, which can be determined by executing command pwd inside the root of the catkin workspace on the device’s terminal.
Define the purpose of the device in the Description box.
Click CONTINUE.
Click COPY to copy the generated device token.
Execute the token at the device’s terminal to set up rapyuta.io’s device agent on the device.
Create Packages
You will create and add two packages, namely, Navigation Application and Turtlebot3 Simulation.
Navigation Application Package
On the left navigation bar, click Development > Packages.
Click ADD NEW PACKAGE.
The name of the package: Navigation Application
Make sure Is a singleton package is not selected.
Ensure Is a bindable package is selected.
The version of the package is 1.0.0
The purpose of the package is to Controlled navigation of turtlebot3
Click NEXT.
The name of the component: navigation_component
The runtime of the component is Device.
Ensure Is ROS Component is selected.
Choose Melodic for ROS Version.
Set Restart Policy to Never.
The name of the executable: navigation_executable
For the Docker Image value, enter: quay.io/rapyuta/io_simulation_tutorials.
In the Command to run in the docker container box, enter the command: roslaunch io_gazebo_turtlebot_bringup app.launch
Click on Add ROS topic. The name of the ROS topic is /cmd_vel, and it is set QoS to Low.
Add a configuration parameter by clicking on Add Parameter. The name of the parameter is SPAWN_TURTLEBOT_ROBOT. The Default value is true.
Click NEXT > CONFIRM PACKAGE CREATION.
Simulation Package
On the left navigation bar, click Development > Packages.
Click ADD NEW PACKAGE.
The name of the package: Simulation
Make sure Is a singleton package is not selected.
Ensure Is a bindable package is selected.
The version of the package is 1.0.0
The purpose of the package is to Simulation of turtlebot3
Click NEXT.
The name of the component: simulation_component
The runtime of the component is Cloud.
Ensure Is ROS Component is selected.
Choose Melodic for ROS Version.
The number of Replicas to run the component is 1
The name of the executable: simulation_executable
For the Docker Image value, enter: quay.io/rapyuta/io_simulation_tutorials.
In the Command to run in the docker container box, enter the command: roslaunch io_gazebo_turtlebot_bringup sim.launch gui:=true
Set Resource Limit to Medium:2 CPU cores, 8 GiB memory
For simulation, the resource limit should either be Medium or Large. Simulation has issues with Small resource limits.
Add the following ROS topics:
Name: /joint_states, QoS: Low
Name: /tf, QoS: Low
Name: /scan, QoS: Low
Name: /odom, QoS: Low
Click NEXT.
Under Inbound ROS Interfaces, Click on Add Topic to add the ROS topic /cmd_vel as an inbound ROS topic.
Click CONFIRM PACKAGE CREATION.
Deploy Packages
You will first deploy the Simulation package, and then the Navigation Application package.
Deploy Simulation Package
On the left navigation bar, click Development > Packages.
Select Simulation package.
Click Deploy package.
The name of deployment: SIMULATION
Enter the value for VNC_PASSWORD
Click CREATE DEPLOYMENT > Confirm
You will redirect to the Details tab of the newly
created deployment. The SIMULATION is successfully running
if the progress bar reaches Succeeded, and the status is Running.
Deploy Navigation Application Package
On the left navigation bar, click Development > Packages.
Select Navigation Application package.
Click Deploy package.
The name of deployment: NAVIGATION
Select Turtlebot3 Navigation Simulation Device as the device on which the navigation_component will be deployed.
Check if the SPAWN_TURTLEBOT_ROBOT parameter has the value true.
Check if the ros_wokspace and ros_distro device configuration variables have values set to the correct absolute path for catkin_ws and melodic respectively.
Click Add dependency to add SIMULATION deployment as a dependent deployment.
Click CREATE DEPLOYMENT > Confirm
You can verify if NAVIGATION APPLICATION is running successfully by
checking if the progress bar reaches Succeeded and status is
Running.
Result
On the Details tab of SIMULATION deployment, copy the value of the network endpoint vnc.
Paste the copied URL address in the address bar of the web browser and press Enter.
Enter the value of VNC_PASSWORD, which you provided while deploying the package when prompted.
Advanced Tips
If you want to run your application separately from the Gazebo simulation on
rapyuta.io, it will need time synchronization. Since the setup runs two ROS Masters, one in the cloud with Gazebo and the other on a
computer with navigation nodes. The clock for these two applications will need
to be in sync. The clock synchronization is by /clock ROS topic, which is published by
Gazebo.