Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
swri_transform_util::Transformer Class Referenceabstract

A base class for transformers. More...

#include <transformer.h>

Inheritance diagram for swri_transform_util::Transformer:
Inheritance graph
[legend]

Public Member Functions

virtual bool GetTransform (const std::string &target_frame, const std::string &source_frame, const ros::Time &time, Transform &transform)=0
 Get a swri_transform_util::Transform. More...
 
void Initialize (const boost::shared_ptr< tf::TransformListener > tf, const boost::shared_ptr< LocalXyWgs84Util > xy_util=boost::shared_ptr< LocalXyWgs84Util >())
 Initialize the Transformer from a tf::TransformListener. More...
 
virtual std::map< std::string, std::vector< std::string > > Supports () const =0
 Get a map of the transforms supported by this Transformer. More...
 
 Transformer ()
 
virtual ~Transformer ()
 

Protected Member Functions

virtual bool GetTransform (const std::string &target_frame, const std::string &source_frame, const ros::Time &time, tf::StampedTransform &transform) const
 
virtual bool Initialize ()
 

Protected Attributes

bool initialized_
 
boost::shared_ptr< LocalXyWgs84Utillocal_xy_util_
 
boost::shared_ptr< tf::TransformListenertf_listener_
 

Detailed Description

A base class for transformers.

Instantiations of this class implement an interface to get transforms from certain types of frames (e.g. TF, WGS84) to other types of frames.

Definition at line 53 of file transformer.h.

Constructor & Destructor Documentation

◆ Transformer()

swri_transform_util::Transformer::Transformer ( )

◆ ~Transformer()

virtual swri_transform_util::Transformer::~Transformer ( )
virtual

Member Function Documentation

◆ GetTransform() [1/2]

virtual bool swri_transform_util::Transformer::GetTransform ( const std::string &  target_frame,
const std::string &  source_frame,
const ros::Time time,
tf::StampedTransform transform 
) const
protectedvirtual

◆ GetTransform() [2/2]

virtual bool swri_transform_util::Transformer::GetTransform ( const std::string &  target_frame,
const std::string &  source_frame,
const ros::Time time,
Transform transform 
)
pure virtual

Get a swri_transform_util::Transform.

Gets the swri_transform_util::Transform that transforms coordinates from the source_frame into the target_frame. If the transform is not available, return false.

Parameters
[in]target_frameDestination frame for transform
[in]source_frameSource frame for transform
[in]timeTime that the transform is valid for. To get the most recent transform, use ros::Time(0)
[out]transformOutput container for the transform
Returns
True if the transform was found, false if no transform between the specified frames is available for the specified time.

Implemented in swri_transform_util::UtmTransformer, and swri_transform_util::Wgs84Transformer.

◆ Initialize() [1/2]

virtual bool swri_transform_util::Transformer::Initialize ( )
protectedvirtual

◆ Initialize() [2/2]

void swri_transform_util::Transformer::Initialize ( const boost::shared_ptr< tf::TransformListener tf,
const boost::shared_ptr< LocalXyWgs84Util xy_util = boost::shared_ptrLocalXyWgs84Util >() 
)

Initialize the Transformer from a tf::TransformListener.

Parameters
tfA shared pointer to a tf::TransformListener that the Transformer wraps. It is recommended that every Transformer in a node use the same tf::TransformListener to reduce redundant computation.

◆ Supports()

virtual std::map<std::string, std::vector<std::string> > swri_transform_util::Transformer::Supports ( ) const
pure virtual

Get a map of the transforms supported by this Transformer.

Returns
A map from source frame IDs to list of destination frame IDs. A source->destination entry does not imply that the inverse transform is supported as well.

Implemented in swri_transform_util::Wgs84Transformer, and swri_transform_util::UtmTransformer.

Member Data Documentation

◆ initialized_

bool swri_transform_util::Transformer::initialized_
protected

Definition at line 100 of file transformer.h.

◆ local_xy_util_

boost::shared_ptr<LocalXyWgs84Util> swri_transform_util::Transformer::local_xy_util_
protected

Definition at line 102 of file transformer.h.

◆ tf_listener_

boost::shared_ptr<tf::TransformListener> swri_transform_util::Transformer::tf_listener_
protected

Definition at line 101 of file transformer.h.


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


swri_transform_util
Author(s): Marc Alban
autogenerated on Tue Oct 3 2023 02:32:38