Writing Your First Rapp
We want to show you how to write a rocon application (rapp). It is a bunch of instructions how to launch the application, something like a wrapper which has special structure and logic. You can find more information in Rapp Specification Document.
We will write a rapp for turtlebot_follower package.
Prerequisites
This lesson is a continuation of the previous lesson: “Multiple TurtleBots in Concert”. If you have not done that lesson, do it firstly.
Creating follower Rapp
1. Create a package my_rapps
.
2. Create a folder for follower
rapp.
3. Copy files from
github.
There are four files: follower.interface
, follower.launch
, follower.rapp
,
follower_bubble_icon.png
. You can find more information about these files in
Create your First Rapp
lesson or on rocon page.
4. Create an empty follower.parameters
file.
5. Modify follower.launch
file. Change default simulation
value to true
.
Old value:
New value:
6. Add this string in follower.rapp
file.
The result:
7. Export the rapp in my_rapps/package.xml
file by adding this string
in <export>
tag.
8. Build package.
Testing
1. Change the path.
2. Show existing rapps.
You will see the long list.
Find my_rapps.
3. Show information about your rapp.
You will see this output.
Modifying gazebo_concert Package
1. Edit gazebo.parameters
file.
Modify robot_rapp_whitelist
for each robot.
Old value:
New value:
2. Build package.
Running follower Rapp
1. Change the path.
2. Launch gazebo_concert.
You will see these strings in each robots terminal.
3. Start rocon_remocon.
4. Press Refresh
.
5. Select Gazebo Concert
->User
->Gazebo Viewer
.
You will see the familiar gazebo world.
6. In a new terminal start follower rapp.
You will see in gamza2
terminal:
NOTE: Only one rapp can be run at one time, otherwise a resource conflict might occur.
7. Select Concert Teleop
in Interactions Chooser
.
8. Select gamza1
in the resource list and capture it.
9. Drive gamza1
using joystick to initiate following behavior.
10. Stop rapp.
11. Interrupt the processes. Close the windows.
You can watch these steps in the video:
We have finished with robot side, go to the next lesson to write user side.