Public Types | Public Member Functions | Protected Attributes
tf_remapper_cpp::TfRemapper Class Reference

Remap frames in TF messages according to given rules. More...

#include <tf_remapper.h>

List of all members.

Public Types

typedef std::map< std::string,
std::string > 
MappingsType

Public Member Functions

void doRemapping (tf2_msgs::TFMessage &message) const
 Rewrite TF frame names according to the rules given in constructor.
tf2_msgs::TFMessage doRemapping (const tf2_msgs::TFMessage &inMessage) const
 Rewrite TF frame names according to the rules given in constructor.
const MappingsTypegetMappings () const
 Get the mappings this remapper uses.
 TfRemapper ()
 Empty constructor with no remappings.
 TfRemapper (MappingsType mappings, bool reverse=false)
 Create the remapper from a constructed set of mappings.
 TfRemapper (const XmlRpc::XmlRpcValue &mappingsParam, bool reverse=false)
 Create the remapper from a XmlRpcValue as read by ros::NodeHandle::getParam().
virtual ~TfRemapper ()

Protected Attributes

MappingsType mappings
 The mappings (keys are old frame names, values are remapped names).

Detailed Description

Remap frames in TF messages according to given rules.

Definition at line 10 of file tf_remapper.h.


Member Typedef Documentation

typedef std::map<std::string, std::string> tf_remapper_cpp::TfRemapper::MappingsType

Definition at line 12 of file tf_remapper.h.


Constructor & Destructor Documentation

Empty constructor with no remappings.

Definition at line 5 of file tf_remapper.cpp.

tf_remapper_cpp::TfRemapper::TfRemapper ( MappingsType  mappings,
bool  reverse = false 
) [explicit]

Create the remapper from a constructed set of mappings.

Parameters:
mappingsThe mappings to use (keys are old frame names, values are remapped names).
reverseIf true, switch role of keys and values in the given map. Entries with empty values are omitted.
Exceptions:
ros::InvalidParameterExceptionif an 'old' key has empty value.

Definition at line 9 of file tf_remapper.cpp.

tf_remapper_cpp::TfRemapper::TfRemapper ( const XmlRpc::XmlRpcValue mappingsParam,
bool  reverse = false 
) [explicit]

Create the remapper from a XmlRpcValue as read by ros::NodeHandle::getParam().

Parameters:
mappingsParamThe XML-RPC-parsed value of the ROS parameter 'mappings'. It is expected to be an array of dicts, each of which contains keys 'old' and 'new'. At least on of them has to have nonempty value. Empty values mark tf frames to be deleted in the given direction.
reverseIf true, switch role of 'old' and 'new' in the given map. Entries with empty 'new' are omitted.
Exceptions:
ros::InvalidParameterExceptionif an 'old' key has empty value.
ros::InvalidParameterExceptionif the mappings do not satisfy the given format.

Definition at line 25 of file tf_remapper.cpp.

Definition at line 7 of file tf_remapper.cpp.


Member Function Documentation

void tf_remapper_cpp::TfRemapper::doRemapping ( tf2_msgs::TFMessage &  message) const

Rewrite TF frame names according to the rules given in constructor.

Parameters:
messageThe original message which is to be modified.

Definition at line 68 of file tf_remapper.cpp.

tf2_msgs::TFMessage tf_remapper_cpp::TfRemapper::doRemapping ( const tf2_msgs::TFMessage &  inMessage) const

Rewrite TF frame names according to the rules given in constructor.

Parameters:
inMessageThe original message.
Returns:
A copy of the original message with rewritten TF frame names.

Definition at line 62 of file tf_remapper.cpp.

Get the mappings this remapper uses.

Returns:
The mappings (keys are old frame names, values are remapped names).

Definition at line 92 of file tf_remapper.cpp.


Member Data Documentation

The mappings (keys are old frame names, values are remapped names).

Definition at line 49 of file tf_remapper.h.


The documentation for this class was generated from the following files:


tf_remapper_cpp
Author(s): Martin Pecka
autogenerated on Tue Mar 19 2019 09:29:23