(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Getting started

Description: This tutorial covers getting the node running and gives an overview of what can be achieved with pattern_manager.

Tutorial Level: BEGINNER

Next Tutorial: Pattern creation

Running the node

To start the node make sure that a roscore is running and run the node executable:

$ rosrun pattern_manager pattern_manager_node

or simply run the .launch file:

$ roslaunch pattern_manager pattern_manager.launch

Services

First off, let us list all the available services that the node provides:

$ rosservice list /pattern_manager/

The output should look like this:

/pattern_manager/create_circular_pattern
/pattern_manager/create_linear_pattern
/pattern_manager/create_rectangular_pattern
/pattern_manager/create_scatter_pattern
/pattern_manager/create_transform
/pattern_manager/get_active_transforms
/pattern_manager/get_active_transforms_info
/pattern_manager/get_children
/pattern_manager/get_children_info
/pattern_manager/get_current_transform
/pattern_manager/get_loggers
/pattern_manager/get_transform_id
/pattern_manager/get_transform_info
/pattern_manager/get_transform_name
/pattern_manager/get_transforms
/pattern_manager/get_transforms_info
/pattern_manager/iterate
/pattern_manager/load
/pattern_manager/print_tree
/pattern_manager/remove_transform
/pattern_manager/save
/pattern_manager/set_active
/pattern_manager/set_iteration_order
/pattern_manager/set_logger_level
/pattern_manager/set_name
/pattern_manager/set_reference_frame
/pattern_manager/set_rotation
/pattern_manager/set_transform_parent
/pattern_manager/set_translation
/pattern_manager/update_transform

We can initially investigate whether any transforms already exist in the manager:

$ rosservice call /pattern_manager/get_transforms "{}"

The output shows that a single transform already exists:

names_and_ids:
  -
    name: "root"
    id: 140718458909632

We can inspect the node by calling the /get_transform_info service:

$ rosservice call /pattern_manager/get_transform_info "id: 140718458909632"
params:
  name: "root"
  parent_id: 140718458909632
  ref_frame: "world"
  id: 140718458909632
  active: False
  translation:
    x: 0.0
    y: 0.0
    z: 0.0
  rotation:
    x: 0.0
    y: 0.0
    z: 0.0
    w: 1.0
  number: 0

As can be seen from the output of the service call, this is the root transform. The root transform is created when the node i started. It is the parent of rest of the transform tree and cannot be removed. The default attributes of the root transform can however be altered. Let us try and change the root transform's reference frame to base:

$ rosservice call /pattern_manager/set_reference_frame "id: 140718458909632
name: 'base'

Calling the /get_transform_info service again confirms that the change has taken effect:

$ rosservice call /pattern_manager/get_transform_info "id: 140718458909632"
params:
  name: "root"
  parent_id: 140718458909632
  ref_frame: "base"
  id: 140718458909632
  active: False
  translation:
    x: 0.0
    y: 0.0
    z: 0.0
  rotation:
    x: 0.0
    y: 0.0
    z: 0.0
    w: 1.0
  number: 0

As the output of rosservice list /pattern_manager/ shows there are a number of services dedicated to altering transform values as necessary.

Now that you have an overview of the basics you can proceed the next tutorial which covers pattern creation.

Wiki: pattern_manager/Tutorials/Getting started (last edited 2020-01-20 10:58:31 by Mads)