Remap frames in TF messages according to given rules. More...
#include <tf_remapper.h>
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 MappingsType & | getMappings () 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). |
Remap frames in TF messages according to given rules.
Definition at line 10 of file tf_remapper.h.
typedef std::map<std::string, std::string> tf_remapper_cpp::TfRemapper::MappingsType |
Definition at line 12 of file tf_remapper.h.
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.
mappings | The mappings to use (keys are old frame names, values are remapped names). |
reverse | If true, switch role of keys and values in the given map. Entries with empty values are omitted. |
ros::InvalidParameterException | if 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().
mappingsParam | The 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. |
reverse | If true, switch role of 'old' and 'new' in the given map. Entries with empty 'new' are omitted. |
ros::InvalidParameterException | if an 'old' key has empty value. |
ros::InvalidParameterException | if the mappings do not satisfy the given format. |
Definition at line 25 of file tf_remapper.cpp.
tf_remapper_cpp::TfRemapper::~TfRemapper | ( | ) | [virtual] |
Definition at line 7 of file tf_remapper.cpp.
void tf_remapper_cpp::TfRemapper::doRemapping | ( | tf2_msgs::TFMessage & | message | ) | const |
Rewrite TF frame names according to the rules given in constructor.
message | The 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.
inMessage | The original message. |
Definition at line 62 of file tf_remapper.cpp.
const tf_remapper_cpp::TfRemapper::MappingsType & tf_remapper_cpp::TfRemapper::getMappings | ( | ) | const |
Get the mappings this remapper uses.
Definition at line 92 of file tf_remapper.cpp.
MappingsType tf_remapper_cpp::TfRemapper::mappings [protected] |
The mappings (keys are old frame names, values are remapped names).
Definition at line 49 of file tf_remapper.h.