Apollo  6.0
Open source self driving car software
Public Member Functions | List of all members
apollo::transform::Buffer Class Reference

#include <buffer.h>

Inheritance diagram for apollo::transform::Buffer:
Inheritance graph
Collaboration diagram for apollo::transform::Buffer:
Collaboration graph

Public Member Functions

int Init ()
 Constructor for a Buffer object. More...
 
virtual TransformStamped lookupTransform (const std::string &target_frame, const std::string &source_frame, const cyber::Time &time, const float timeout_second=0.01f) const
 Get the transform between two frames by frame ID. More...
 
virtual TransformStamped lookupTransform (const std::string &target_frame, const cyber::Time &target_time, const std::string &source_frame, const cyber::Time &source_time, const std::string &fixed_frame, const float timeout_second=0.01f) const
 Get the transform between two frames by frame ID assuming fixed frame. More...
 
virtual bool canTransform (const std::string &target_frame, const std::string &source_frame, const cyber::Time &target_time, const float timeout_second=0.01f, std::string *errstr=nullptr) const
 Test if a transform is possible. More...
 
virtual bool canTransform (const std::string &target_frame, const cyber::Time &target_time, const std::string &source_frame, const cyber::Time &source_time, const std::string &fixed_frame, const float timeout_second=0.01f, std::string *errstr=nullptr) const
 Test if a transform is possible. More...
 
bool GetLatestStaticTF (const std::string &frame_id, const std::string &child_frame_id, TransformStamped *tf)
 
- Public Member Functions inherited from apollo::transform::BufferInterface
template<typename T >
T & transform (const T &in, T &out, const std::string &target_frame, float timeout=0.0f) const
 
template<typename T >
transform (const T &in, const std::string &target_frame, float timeout=0.0f) const
 
template<typename A , typename B >
B & transform (const A &in, B &out, const std::string &target_frame, float timeout=0.0f) const
 
template<typename T >
T & transform (const T &in, T &out, const std::string &target_frame, const cyber::Time &target_time, const std::string &fixed_frame, float timeout=0.0f) const
 
template<typename T >
transform (const T &in, const std::string &target_frame, const cyber::Time &target_time, const std::string &fixed_frame, float timeout=0.0f) const
 
template<typename A , typename B >
B & transform (const A &in, B &out, const std::string &target_frame, const cyber::Time &target_time, const std::string &fixed_frame, float timeout=0.0f) const
 

Member Function Documentation

◆ canTransform() [1/2]

virtual bool apollo::transform::Buffer::canTransform ( const std::string &  target_frame,
const std::string &  source_frame,
const cyber::Time target_time,
const float  timeout_second = 0.01f,
std::string *  errstr = nullptr 
) const
virtual

Test if a transform is possible.

Parameters
target_frameThe frame into which to transform
source_frameThe frame from which to transform
target_timeThe time at which to transform
timeoutHow long to block before failing
errstrA pointer to a string which will be filled with why the transform failed, if not nullptr
Returns
True if the transform is possible, false otherwise

Implements apollo::transform::BufferInterface.

◆ canTransform() [2/2]

virtual bool apollo::transform::Buffer::canTransform ( const std::string &  target_frame,
const cyber::Time target_time,
const std::string &  source_frame,
const cyber::Time source_time,
const std::string &  fixed_frame,
const float  timeout_second = 0.01f,
std::string *  errstr = nullptr 
) const
virtual

Test if a transform is possible.

Parameters
target_frameThe frame into which to transform
target_timeThe time into which to transform
source_frameThe frame from which to transform
source_timeThe time from which to transform
fixed_frameThe frame in which to treat the transform as constant in time
timeoutHow long to block before failing
errstrA pointer to a string which will be filled with why the transform failed, if not nullptr
Returns
True if the transform is possible, false otherwise

Implements apollo::transform::BufferInterface.

◆ GetLatestStaticTF()

bool apollo::transform::Buffer::GetLatestStaticTF ( const std::string &  frame_id,
const std::string &  child_frame_id,
TransformStamped *  tf 
)

◆ Init()

int apollo::transform::Buffer::Init ( )

Constructor for a Buffer object.

Parameters
cache_timeHow long to keep a history of transforms
debugWhether to advertise the view_frames service that exposes debugging information from the buffer
Returns

◆ lookupTransform() [1/2]

virtual TransformStamped apollo::transform::Buffer::lookupTransform ( const std::string &  target_frame,
const std::string &  source_frame,
const cyber::Time time,
const float  timeout_second = 0.01f 
) const
virtual

Get the transform between two frames by frame ID.

Parameters
target_frameThe frame to which data should be transformed
source_frameThe frame where the data originated
timeThe time at which the value of the transform is desired. (0 will get the latest)
timeoutHow long to block before failing
Returns
The transform between the frames

Possible exceptions tf2::LookupException, tf2::ConnectivityException, tf2::ExtrapolationException, tf2::InvalidArgumentException

Implements apollo::transform::BufferInterface.

◆ lookupTransform() [2/2]

virtual TransformStamped apollo::transform::Buffer::lookupTransform ( const std::string &  target_frame,
const cyber::Time target_time,
const std::string &  source_frame,
const cyber::Time source_time,
const std::string &  fixed_frame,
const float  timeout_second = 0.01f 
) const
virtual

Get the transform between two frames by frame ID assuming fixed frame.

Parameters
target_frameThe frame to which data should be transformed
target_timeThe time to which the data should be transformed. (0 will get the latest)
source_frameThe frame where the data originated
source_timeThe time at which the source_frame should be evaluated. (0 will get the latest)
fixed_frameThe frame in which to assume the transform is constant in time.
timeoutHow long to block before failing
Returns
The transform between the frames

Possible exceptions tf2::LookupException, tf2::ConnectivityException, tf2::ExtrapolationException, tf2::InvalidArgumentException

Implements apollo::transform::BufferInterface.


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