Wrapper around tf::TransformListener to support non-TF transforms. More...
#include <transform_manager.h>
Public Member Functions | |
bool | GetTransform (const std::string &target_frame, const std::string &source_frame, const ros::Time &time, Transform &transform) const |
Get the Transform between two frames at a specified time. More... | |
bool | GetTransform (const std::string &target_frame, const std::string &source_frame, Transform &transform) const |
Get the most recent Transform between two frames. More... | |
bool | GetTransform (const std::string &target_frame, const std::string &source_frame, const ros::Time &time, tf::StampedTransform &transform) const |
Get the tf::Transform between two frames at a specified time. More... | |
bool | GetTransform (const std::string &target_frame, const std::string &source_frame, tf::StampedTransform &transform) const |
Get the most recent tf::Transform between two frames. More... | |
bool | GetTransform (const std::string &target_frame, const std::string &source_frame, const ros::Time &time, const ros::Duration &timeout, tf::StampedTransform &transform) const |
Get the tf::Transform between two frames at a specified time. More... | |
bool | GetTransform (const std::string &target_frame, const std::string &source_frame, const ros::Duration &timeout, tf::StampedTransform &transform) const |
Get the most recent tf::Transform between two frames. More... | |
void | Initialize (boost::shared_ptr< tf::TransformListener > tf=boost::make_shared< tf::TransformListener >()) |
Initialize the TransformManager with a tf::TransformListener. More... | |
const LocalXyWgs84UtilPtr & | LocalXyUtil () const |
LocalXyUtil exposes the private instance of LocalXyWgs84Util. More... | |
bool | SupportsTransform (const std::string &target_frame, const std::string &source_frame) const |
Check whether the TransformManager supports transforms from source_frame to target_frame. More... | |
TransformManager (boost::shared_ptr< tf::TransformListener > tf=NULL) | |
~TransformManager () | |
Private Attributes | |
LocalXyWgs84UtilPtr | local_xy_util_ |
boost::shared_ptr< tf::TransformListener > | tf_listener_ |
SourceTargetMap | transformers_ |
Wrapper around tf::TransformListener to support non-TF transforms.
TransformManager wraps tf::TransformListener and provides a similar interface to get Transforms between TF frames, UTM, and WGS84.
TransformManager uses PluginLib to load all of the swri_transform_util::Transformer plugins it can find. To extend the functionality of TranformManager, create a new swri_transform_util::Transformer plugin that implements the desired transform.
Definition at line 62 of file transform_manager.h.
swri_transform_util::TransformManager::TransformManager | ( | boost::shared_ptr< tf::TransformListener > | tf = NULL | ) |
swri_transform_util::TransformManager::~TransformManager | ( | ) |
bool swri_transform_util::TransformManager::GetTransform | ( | const std::string & | target_frame, |
const std::string & | source_frame, | ||
const ros::Time & | time, | ||
Transform & | transform | ||
) | const |
Get the Transform between two frames at a specified time.
This function gets the transform from source_frame to target_frame at the specified time and returns it as a swri_transform_util::Transform.
The frame IDs for target_frame and source_frame can be either a frame id in the current TF tree or one of the special frames /UTM or /WGS84.
This method waits for a 0.1 second timeout if the transform is not immediately available.
[in] | target_frame | The TF (or special) frame id of the target |
[in] | source_frame | The TF (or special) frame id of the source |
[in] | time | The requested time to request the transform. ros::Time(0) means the most recent time for which a valid transform is available. |
[out] | transform | The transform requested. If the function returns false, transform is not mutated. |
bool swri_transform_util::TransformManager::GetTransform | ( | const std::string & | target_frame, |
const std::string & | source_frame, | ||
Transform & | transform | ||
) | const |
Get the most recent Transform between two frames.
This function gets the most recent transform from source_frame to target_frame and returns it as a swri_transform_util::Transform.
The frame IDs for target_frame and source_frame can be either a frame id in the current TF tree or one of the special frames /UTM or /WGS84.
This method waits for a 0.1 second timeout if the transform is not immediately available.
[in] | target_frame | The TF (or special) frame id of the target |
[in] | source_frame | The TF (or special) frame id of the source |
[out] | transform | The transform requested. If the function returns false, transform is not mutated |
bool swri_transform_util::TransformManager::GetTransform | ( | const std::string & | target_frame, |
const std::string & | source_frame, | ||
const ros::Time & | time, | ||
tf::StampedTransform & | transform | ||
) | const |
Get the tf::Transform between two frames at a specified time.
This function is a thin wrapper around the tf::TransformListener. Only TF frames are supported.
This method waits for a 0.1 second timeout if the transform is not immediately available.
[in] | target_frame | The TF frame id of the target |
[in] | source_frame | The TF frame id of the source |
[in] | time | The requested time to request the transform. ros::Time(0) means the most recent time for which a valid transform is available. |
[out] | transform | The transform requested. If the function returns false, transform is not mutated. |
bool swri_transform_util::TransformManager::GetTransform | ( | const std::string & | target_frame, |
const std::string & | source_frame, | ||
tf::StampedTransform & | transform | ||
) | const |
Get the most recent tf::Transform between two frames.
This function is a thin wrapper around the tf::TransformListener. Only TF frames are supported.
This method waits for a 0.1 second timeout if the transform is not immediately available.
[in] | target_frame | The TF frame id of the target |
[in] | source_frame | The TF frame id of the source |
[out] | transform | The transform requested. If the function returns false, transform is not mutated. |
bool swri_transform_util::TransformManager::GetTransform | ( | const std::string & | target_frame, |
const std::string & | source_frame, | ||
const ros::Time & | time, | ||
const ros::Duration & | timeout, | ||
tf::StampedTransform & | transform | ||
) | const |
Get the tf::Transform between two frames at a specified time.
This function is a thin wrapper around the tf::TransformListener. Only TF frames are supported.
If the frames are not immediately available, this method will wait for the frames for the specified timeout period.
[in] | target_frame | The TF frame id of the target |
[in] | source_frame | The TF frame id of the source |
[in] | time | The requested time to request the transform. ros::Time(0) means the most recent time for which a valid transform is available. |
[in] | timeout | How long to wait for the transform to be available before returning False. |
[out] | transform | The transform requested. If the function returns false, transform is not mutated. |
bool swri_transform_util::TransformManager::GetTransform | ( | const std::string & | target_frame, |
const std::string & | source_frame, | ||
const ros::Duration & | timeout, | ||
tf::StampedTransform & | transform | ||
) | const |
Get the most recent tf::Transform between two frames.
This function is a thin wrapper around the tf::TransformListener. Only TF frames are supported.
If the frames are not immediately available, this method will wait for the frames for the specified timeout period.
[in] | target_frame | The TF frame id of the target |
[in] | source_frame | The TF frame id of the source |
[in] | timeout | How long to wait for the transform to be available before returning False. |
[out] | transform | The transform requested. If the function returns false, transform is not mutated. |
void swri_transform_util::TransformManager::Initialize | ( | boost::shared_ptr< tf::TransformListener > | tf = boost::make_shared< tf::TransformListener >() | ) |
Initialize the TransformManager with a tf::TransformListener.
The TransformManager must be initialized before it can be used.
tf | A shared pointer to a tf::TransformListener that the Transformer wraps. |
const LocalXyWgs84UtilPtr& swri_transform_util::TransformManager::LocalXyUtil | ( | ) | const |
LocalXyUtil exposes the private instance of LocalXyWgs84Util.
bool swri_transform_util::TransformManager::SupportsTransform | ( | const std::string & | target_frame, |
const std::string & | source_frame | ||
) | const |
Check whether the TransformManager supports transforms from source_frame to target_frame.
Supporting a transform does not imply that the TransformManager supports the inverse.
[in] | target_frame | The TF (or special) frame id of the target |
[in] | source_frame | The TF (or special) frame id of the source |
|
private |
Definition at line 251 of file transform_manager.h.
|
private |
Definition at line 249 of file transform_manager.h.
|
private |
Definition at line 253 of file transform_manager.h.