Skip to content

Tutorial 5: User Interface

Matthias Mayr edited this page Apr 28, 2023 · 1 revision

In this tutorial we will have a closer look to the user interface using the examples from skiros2_examples.

Running skills

To start, launch the turtlesim_example:

roslaunch skiros2_examples turtlesim_example.launch

This will bring up two windows, the SkiROS user interface and a window displaying the turtle simulation. Initially the Task tab will be displayed. This tab allows the user to start and stop the execution of skills. Start by spawning another turtle by clicking on the spawn_random skill and give the turtle a name such as "turtle_2". Click on the start button in the upper left corner to start the execution of the selected skill.

Another turtle will now be spawned on the screen in a random location. The name specified is an argument to a parameter of the skill and it will be a part of the turtles label in the world model. By clicking the box "Advanced options", the optional parameters to the skill are shown. For this skill, the optional parameters specify what range the turtle has a chance of spawning in.

Now select the follow skill, give as parameters the two turtles and start the skill. The turtle specified by the parameter Turtle will now start to follow the turtle specified by the parameter Target. The skill will continue executing until we stop it by clicking the stop button in the upper left corner.

The bottom panel shows the behavior tree of the skill being execute. We see that the skill follow consist of four primitives and to the right of each we see various information being printed by each node while the skill runs.

Start the skill orbit and give two different turtles as arguments for Turtle1 and Turtle2. The two turtles will now orbit around each other. From the skill graph we can see that the orbit skill in turn consists of two follow skills in sequence, one for each turtle.

To view additional information about a running skill, click the boxes "Skill info window" and "Show running parameters" at the bottom of the window. A new window will appear and nodes in the skill graph can now be inspected by clicking on them. This will show all the messages being printed by the node in a list for better viewing.

A skill that is being executed can either be stopped or paused. Pausing halts the execution and leaves the sate of the skill unchanged. Pressing the start button after pausing will resume the execution of the skill. Stopping also halts the execution but resets the skill so that it will start over the next time the start button is pressed. We can also step through the execution of a skill by clicking the Tick skill once button to the right of the start button.

Editing the world model

Please, follow the Tutorial: Use world knowledge in a skill before continuing with this tutorial.

Close the turtlesim_example and launch the follow_pose_example:

roslaunch skiros2_examples follow_pose_example.launch

This will bring up the skiros2 user interface and RViz. Run the skill follow_pose which will spawn three poses and do a pick and place with one of them which can be seen in the RViz window. Click the World Model tab in the top left corner. The left panel shows the scene graph and elements can be selected by clicking on them. When an element is clicked, its properties will show up in the top right panel and its relations will show up in the bottom right panel. The buttons at the top of each panel, labeled with plus and minus signs, allow us to edit the world model by adding or removing objects, properties and relations. An element can be added as a child to the root of the scene graph but it can also be added as a child to any other node in the graph.

Click on one of the TransformationPoses in the scene graph to select it (if there are none then run the follow_pose skill) and press the add object button (+) at the top of the panel. This will bring up the add object dialog. To add a TransformationPose choose Location as type, TransformationPose as sub type and transformation_pose_t as individual then click "OK". This will add a new TransformationPose based on the template transformation_pose_t. The new TransformationPose will also be a child of the TransformationPose you chose in the scene graph. Now select the newly added TransformationPose and set its PositionZ property to 1.0. This position will now be specified in relation to the parent in the scene graph. In the figure below, TransformationPose-36 has been added as a child to TransformationPose-33.

The current scene can be saved to a file by clicking the save scene button at the bottom of the window and a scene can also be loaded from a file by clicking the load scene button.

Interactive markers

It is possible to interact with objects in the world model through RViz with Interactive Markers. To try this out launch the follow pose example:

roslaunch skiros2_examples follow_pose_example.launch

In RViz expand the display tab by clicking the arrow on the left side of the window. Click the add button at the bottom, click on the By topic tab, select Interactive Markers and click OK. In the skiros gui click on the World Model tab and select an object such as test_robot. You can now move the object by interacting with it through RViz and the new object pose will be updated in the world model and the skiros gui.