Skip to content
Snippets Groups Projects

Description

This ROS package provides both the module and behavior tree layers to control the play motion feature of the TIAGo robot. The play motion feature allows the robot to execute a predefined motion including all the joints of the robot (arms, grippers, torso and head) but not the mobile platform.

For further information on the TIAGo native interface to the play motion feature see chapter 29 in the robot's handbook.

For further details on the concept of module check the iri_ros_tools documentation.

For further details on the use of behavior trees at IRI check the iri_behaviortree documentation.

This ROS package also includes two example uses cases of both the module and behavior tree layers. The next image shows the relationship between the four ROS nodes provided by this package.

relationship between the ROS nodes provided by this package

Module layer

The main features provided by this module are:

  • The desired motion is identified by its name.
  • Since each robot can have different pre-defined motions, the existence of the desired motion is checked before trying to execute it.
  • Interfaces with the TIAGO native play motion action server
  • Handles all possible outcomes of the action.

ROS interfaces

Action clients

  • play_motion<play_motion_msgs::PlayMotionAction>: Client of the play motion action of the TIAGo robot.

Parameters

  • play_motion_module_rate_hz (default=10.0): The desired rate in Hertz of the internal state machine.
  • play_num_retries (default=1): The maximum number of attempts to start the action before reporting and error.
  • play_feedback_watchdog_time_s (default=1.0): The maximum time between two consecutive feedback messages before reporting an error.
  • play_enable_watchdog (defaul=False): Whether to enable or disable the watchdog feature.
  • play_timeout_s (default=10.0): The maximum time allowed to complete the action before reporting an error.
  • play_enable_timeout (default=True=: Whether to enable or disable the timeout feature.
  • play_enabled (default=True): Whether to enable or disable the module. If disabled, all action will immediately finish successfully.

See the action wrapper documentation for more detailed description of these parameters.

  • motions_param_path (default=/play_motion/motions): parameter server namespace where all motions are defined.

Dependencies

This package requires the following packages:

  • iri_ros_tools: Basic implementation of the IRI ROS module as well as other useful tools.
  • iri_base_algorithm: The base class definition for the module class.

Behavior tree layer

The Behavior tree layer exports all the module's features to be used in the context of a Behavior tree. This layer provides both synchronous (the action is called continuously until it either fails or success) and asynchronous (the action is called ones and several conditions can be used to check its status) interfaces.

Dependencies

This package requires the following packages:

  • iri_behaviortree: IRI behavior tree ROS wrapper providing some additional features.

Module example client

This client uses the module layer of the play motion feature to provide an example use case that can be used as a reference on how to use it in more complex scenarios. The user interface is provided through the dynamic reconfigure interface.

ROS interfaces

Parameters

  • motion_name (default=): The name of the motion to execute.
  • start_motion (default=False): A signal to start the motion.
  • cancel_motion (default=False): A signal to cancel the execution of the current motion.

Behavior tree example client

This client client uses the behavior tree layer of the play motion feature to provide an example use case that can be used as a reference on how to use it in more complex behavior tree. The user interface is provided through the dynamic reconfigure interface, and the actual execution of the tree can be monitored using the Groot tool.

ROS interfaces

Parameters

  • bt_client_rate (default=10.0): The desired rate in Hertz of the Behavior tree tick.
  • bt_client_enable_cout_logger (default=False): Whether to enable or disable the on-screen messages.
  • bt_client_enable_minitrace_logger (default=False):
  • bt_client_enable_file_logger (default=False): Whether to enable or disable the file logs.
  • bt_client_enable_zmq_publisher (default=False): Whether to enable or disable the link with the Groot application.

See the iri_behaviortree documentation for a more detailed description of these parameters.

  • motion_name (default=): The name of the motion to execute.
  • START (default=False): A signal to start the motion.
  • RESTART (default=False):
  • set_motion (default=False):

Dependencies

This package requires the following packages:

  • iri_base_bt_client: Base class for all behavior tree client nodes providing some common useful features.

Installation

Move to the active workspace:

roscd && cd ../src

Clone the repository:

git clone ssh://git@gitlab.iri.upc.edu:2202/labrobotica/ros/platforms/tiago/iri_tiago_play_motion_module.git

Install ROS dependencies:

roscd
cd ..
rosdep install -i -r --from-paths src

Compile the workspace:

catkin_make

Available motions

To know which motions are available for each robot, execute the following command:

rosparam list | grep play_motion/motions

Launch

Two sets of launch files are provided, one for the TIAGo robot and the other one for the IVO robot. Make sure either the simulated robot has been launched or the computer is connected to the network of the robot before launching the play motion client.

To launch the module client for the TIAGo robot, execute the following command:

roslaunch tiago_play_motion_module tiago_play_motion_client.launch

and to launch it for the IVO robot, execute the following command:

roslaunch tiago_play_motion_module ivo_play_motion_client.launch

This will open a dynamic reconfigure window as shown in the next image. Selecting the /_play_motion_client will show the necessary parameters to control the play motion feature. Writing the desired motion_name and pressing start_motion will start its execution. Any problem will be reported in the terminal window.

Dynamic reconfigure module client interface

To launch the behavior tree client for the TIAGo robot, execute the following command:

roslaunch tiago_play_motion_module tiago_play_motion_bt_client.launch

and to launch it for the IVO robot, execute the following command:

roslaunch tiago_play_motion_module ivo_play_motion_bt_client.launch

This will open a dynamic reconfigure window as shown in the next image. Pressing START will start the execution of the behavior tree but it will still not execute any motion. To do so, write down the desired motion_name and press set_motion. Any problem will be reported in the terminal window.

Dynamic reconfigure behavior tree client interface

To display the execution of the behavior tree, first enable the you can launch the bt_client_enable_zmq_publisher option in the dynamic reconfigure. Then launch the Groot application with the following command:

Groot

select the Monitor option, and connect to the local IP address (localhost).

The Groot application will show the active behavior tree as shown in the next image, the active state will be shown in green, and any error will be shown in red.

Groot application showing the behavior tree