You're reading the documentation for an older, but still supported, version of ROS 2. For information on the latest version, please have a look at Kilted.

Force Torque Sensor Broadcaster

Broadcaster of messages from force/torque state interfaces of a robot or sensor. The published message type is geometry_msgs/msg/WrenchStamped.

The controller is a wrapper around ForceTorqueSensor semantic component (see controller_interface package).

Parameters

This controller uses the generate_parameter_library to handle its parameters. The parameter definition file located in the src folder contains descriptions for all the parameters used by the controller.

The interfaces can be defined in two ways, using the sensor_name or the interface_names parameter: Those two parameters cannot be defined at the same time.

Full list of parameters:

frame_id (string)

Sensor’s frame_id in which values are published.

Default: “”

Constraints:

  • parameter is not empty

sensor_name (string)

Name of the sensor used as prefix for interfaces if there are no individual interface names defined. If used, standard interface names for a 6D FTS will be used: <sensor_name>/force.x, ..., <sensor_name>/torque.z

Default: “”

interface_names

(optional) Defines custom, per axis interface names. This is used if different prefixes, i.e., sensor name, or non-standard interface names are used. It is sufficient that only one interface_name is defined. This enables the broadcaster to use force sensing cells with less than six measuring axes. An example definition is:

interface_names:
  force:
    x: example_name/example_interface
interface_names.force.x (string)

Name of the state interface with force values on ‘x’ axis.

Default: “”

interface_names.force.y (string)

Name of the state interface with force values on ‘y’ axis.

Default: “”

interface_names.force.z (string)

Name of the state interface with force values on ‘z’ axis.

Default: “”

interface_names.torque.x (string)

Name of the state interface with torque values around ‘x’ axis.

Default: “”

interface_names.torque.y (string)

Name of the state interface with torque values around ‘y’ axis.

Default: “”

interface_names.torque.z (string)

Name of the state interface with torque values around ‘z’ axis.

Default: “”

An example parameter file for this controller can be found in the test directory:

test_force_torque_sensor_broadcaster:
  ros__parameters:

    frame_id:  "fts_sensor_frame"

Wrench Transformer Node

The package provides a standalone ROS 2 node wrench_transformer_node that transforms wrench messages published by the ForceTorqueSensorBroadcaster controller to different target frames using TF2. This is useful when applications need force/torque data in coordinate frames other than the sensor frame.

The node subscribes to wrench messages from the broadcaster (either raw or filtered) and publishes transformed versions to separate topics for each target frame.

Usage

The wrench transformer can be launched with target frames passed directly as positional arguments:

ros2 run force_torque_sensor_broadcaster wrench_transformer_node frame1 frame2

Target frames may also be set via the target_frames parameter:

ros2 run force_torque_sensor_broadcaster wrench_transformer_node \
  --ros-args -p target_frames:="['frame1','frame2']"

Positional arguments override the parameter value when both are provided.

Wrench Transformer Parameters

The wrench transformer uses the generate_parameter_library to handle its parameters. The parameter definition file for the wrench transformer contains descriptions for all the parameters.

Full list of parameters:

target_frames (string_array)

Array of target frame names to transform the input wrench to. For each frame, a separate output topic will be published.

Default: {}

Constraints:

  • parameter is not empty

tf_timeout (double)

Timeout in seconds for TF lookups when transforming wrenches between frames.

Default: 0.1

Topics

The node subscribes to:

  • ~/wrench (raw wrench messages). To subscribe to filtered wrench messages, use topic remapping: ros2 run ... --ros-args -r ~/wrench:=<namespace>/wrench_filtered

The node publishes:

  • <namespace>/<target_frame>/wrench for each target frame specified in target_frames

    • If the node is in the root namespace (/), the namespace defaults to the node name (e.g., /fts_wrench_transformer/<target_frame>/wrench)

    • If the input topic is remapped to a filtered topic (contains “filtered” in the name), the output topics automatically append _filtered suffix (e.g., <namespace>/<target_frame>/wrench_filtered)

    • This allows users to distinguish between transformed raw wrench data and transformed filtered wrench data