Skip to content

Tutorial 6: Using the Robot Manager

RValner edited this page Apr 13, 2023 · 5 revisions

Note: This tutorial assumes that you are familiar with the concept of TeMoto Robot Manager and Robot Manager Interface. See Overview 4: "Robot Manager" for more information.

Note: In previous tutorials, we created a "custom_temoto_config" package from scratch to understand the structure of the TeMoto config. All examples shown in this tutorial can be found and replicated via Temoto Tutorials repository, which contains a set of TeMoto actions to control a robot.


In order to use TeMoto Robot Manager subsystem within TeMoto, you need to run the temoto_robot_manager node.

  • If you create the temoto_config from scratch, make sure you have the following lines in your temoto.launch file:
<arg name="robot_config_base_path" default="$(find tutorials_temoto_config)/config" />

<node name="temoto_robot_manager" 
      pkg="temoto_robot_manager" 
      type="temoto_robot_manager" 
      output="screen" 
      respawn="$(arg respawn_nodes)"
      args="--config-base-path $(arg robot_config_base_path)"/>

See temoto.launch for reference.

  • Include temoto_robot_manager in the find_package section of the CMakeList.txt

  • Add the dependency to the package.xml

<depend>temoto_robot_manager</depend>

Note that the robot_config_base_path points to the config folder that holds the robot_description.yaml file. For example, the included "tutorials_temoto_config/config/robot_description.yaml" contains description, navigation, and manipulation information for the simulated dual arm Husky robot used in this Tutorial. More information on configuring the robot_description.yaml can be found in Overview 4.

  • To use the Robot Manager Interface either in a regular ROS c++ Node or in a TeMoto action, include the following header
#include "temoto_robot_manager/robot_manager_interface.h"
  • To create a Robot Manager Interface Object
temoto_robot_manager::RobotManagerInterface rmi_;
rmi_.initialize();

Now you should be able to either initialize or command a robot using the RMI.

Demo 1: Using Robot Manager Interface in a regular ROS Node

This tutorial launches a dual arm mobile manipulator (husky robot), that provides a navigation and manipulation functionalities. For this demo (1), we will use a regular ROS Node with a RMI object to load and command the robot.

This node creates a RMI object, that provides a simplified API for communicating with the Robot Manager. The first step is to initialize the robot, which basically launches the drivers and controllers defined on the robot_description.yaml file, then it sends a navigation goal for the mobile base, and once the robot reaches the goal, the node commands the arm to move the arm to a target pose. At the end, the process manager unloads all of the resources.

Start TeMoto

roslaunch tutorials_temoto_config temoto_husky.launch temoto_namespace:=my_temoto

Run the node that uses the RMI to command the robot.

rosrun tutorials_temoto_config rmi_command_robot __ns:=my_temoto

If you want to change the goal poses, change the values of the target_pose in the "rmi_command_robot.cpp", build and run it again.

Demo 2: Using the RMI in a TeMoto Action

The ta_navigation_action provided on the Temoto_tutorials contains the required commands to send a 2D navigation goal to a mobile base using the RMI.

Start TeMoto

roslaunch tutorials_temoto_config temoto_husky.launch temoto_namespace:=my_temoto

Initialize the robot

roslaunch ta_initialize_robot invoke_action.launch wake_word:=my_temoto

Wait until the robot is fully initialized You should see in the terminal

vaultbot_sim initialized

Trigger the TeMoto Action

roslaunch ta_navigate_robot invoke_action.launch wake_word:=my_temoto

Once the robot reaches the location, you should see in the terminal

Goal reached
[from my_temoto/executeTemotoAction]: Done navigating
Action instance destructed
[monitoringLoop] Clearing umrf graph 'ta_navigate_robot'

You can change the navigation goal on the ta_navigation_robot.umrfg.json file. There is no need to build again. Trigger the TeMoto Action again.

Demo 3: Run the Husky autonomous navigation example

For this demo(3) we will trigger a UMRF graph that contains three navigation actions in a loop (same action with different input parameters).

UMRF Graph

Figure 8: UMRF Graph with 3 navigation actions in cycle.

Launch TeMoto:

roslaunch tutorials_temoto_config temoto_husky.launch temoto_namespace:=my_temoto

Now let's invoke an UMRF graph (combines TeMoto actions to a graph) which orchestrates our navigation behavior. First open another terminal and go to the umrf graphs directory

roscd tutorials_temoto_config/../umrf_graphs

Run an action that initializes the robot:

rosrun temoto_action_engine umrf_graph_publisher vaultbot_initialize.umrfg.json my_temoto

After husky Gazebo sim has been successfully loaded, make it navigate through 3 goal locations repeatedly (invoke the command in the same terminal as the last one):

rosrun temoto_action_engine umrf_graph_publisher vaultbot_nav_cycle.umrfg.json my_temoto

In order to stop the navigation graph, run:

rostopic pub /broadcast_stop_umrf_graph temoto_action_engine/BroadcastStopUmrfGraph "umrf_graph_name: 'vaultbot_nav_cycle'
targets:
- 'my_temoto'"

Clone this wiki locally