Standard implementation of the tf2_ros::BufferInterface abstract data type. More...
#include <buffer.h>
Public Member Functions | |
Buffer (ros::Duration cache_time=ros::Duration(BufferCore::DEFAULT_CACHE_TIME), bool debug=false) | |
Constructor for a Buffer object. | |
virtual bool | canTransform (const std::string &target_frame, const std::string &source_frame, const ros::Time &target_time, const ros::Duration timeout, std::string *errstr=NULL) const |
Test if a transform is possible. | |
virtual bool | canTransform (const std::string &target_frame, const ros::Time &target_time, const std::string &source_frame, const ros::Time &source_time, const std::string &fixed_frame, const ros::Duration timeout, std::string *errstr=NULL) const |
Test if a transform is possible. | |
virtual geometry_msgs::TransformStamped | lookupTransform (const std::string &target_frame, const std::string &source_frame, const ros::Time &time, const ros::Duration timeout) const |
Get the transform between two frames by frame ID. | |
virtual geometry_msgs::TransformStamped | lookupTransform (const std::string &target_frame, const ros::Time &target_time, const std::string &source_frame, const ros::Time &source_time, const std::string &fixed_frame, const ros::Duration timeout) const |
Get the transform between two frames by frame ID assuming fixed frame. | |
Private Member Functions | |
bool | checkAndErrorDedicatedThreadPresent (std::string *errstr) const |
bool | getFrames (tf2_msgs::FrameGraph::Request &req, tf2_msgs::FrameGraph::Response &res) |
Private Attributes | |
ros::ServiceServer | frames_server_ |
Standard implementation of the tf2_ros::BufferInterface abstract data type.
Inherits tf2_ros::BufferInterface and tf2::BufferCore. Stores known frames and offers a ROS service, "tf_frames", which responds to client requests with a response containing a tf2_msgs::FrameGraph representing the relationship of known frames.
tf2_ros::Buffer::Buffer | ( | ros::Duration | cache_time = ros::Duration(BufferCore::DEFAULT_CACHE_TIME) , |
bool | debug = false |
||
) |
Constructor for a Buffer object.
cache_time | How long to keep a history of transforms |
debug | Whether to advertise the view_frames service that exposes debugging information from the buffer |
Definition at line 43 of file buffer.cpp.
bool tf2_ros::Buffer::canTransform | ( | const std::string & | target_frame, |
const std::string & | source_frame, | ||
const ros::Time & | target_time, | ||
const ros::Duration | timeout, | ||
std::string * | errstr = NULL |
||
) | const [virtual] |
Test if a transform is possible.
target_frame | The frame into which to transform |
source_frame | The frame from which to transform |
target_time | The time at which to transform |
timeout | How long to block before failing |
errstr | A pointer to a string which will be filled with why the transform failed, if not NULL |
Implements tf2_ros::BufferInterface.
Definition at line 119 of file buffer.cpp.
bool tf2_ros::Buffer::canTransform | ( | const std::string & | target_frame, |
const ros::Time & | target_time, | ||
const std::string & | source_frame, | ||
const ros::Time & | source_time, | ||
const std::string & | fixed_frame, | ||
const ros::Duration | timeout, | ||
std::string * | errstr = NULL |
||
) | const [virtual] |
Test if a transform is possible.
target_frame | The frame into which to transform |
target_time | The time into which to transform |
source_frame | The frame from which to transform |
source_time | The time from which to transform |
fixed_frame | The frame in which to treat the transform as constant in time |
timeout | How long to block before failing |
errstr | A pointer to a string which will be filled with why the transform failed, if not NULL |
Implements tf2_ros::BufferInterface.
Definition at line 148 of file buffer.cpp.
bool tf2_ros::Buffer::checkAndErrorDedicatedThreadPresent | ( | std::string * | errstr | ) | const [private] |
Definition at line 185 of file buffer.cpp.
bool tf2_ros::Buffer::getFrames | ( | tf2_msgs::FrameGraph::Request & | req, |
tf2_msgs::FrameGraph::Response & | res | ||
) | [private] |
Definition at line 177 of file buffer.cpp.
geometry_msgs::TransformStamped tf2_ros::Buffer::lookupTransform | ( | const std::string & | target_frame, |
const std::string & | source_frame, | ||
const ros::Time & | time, | ||
const ros::Duration | timeout | ||
) | const [virtual] |
Get the transform between two frames by frame ID.
target_frame | The frame to which data should be transformed |
source_frame | The frame where the data originated |
time | The time at which the value of the transform is desired. (0 will get the latest) |
timeout | How long to block before failing |
Possible exceptions tf2::LookupException, tf2::ConnectivityException, tf2::ExtrapolationException, tf2::InvalidArgumentException
Implements tf2_ros::BufferInterface.
Definition at line 54 of file buffer.cpp.
geometry_msgs::TransformStamped tf2_ros::Buffer::lookupTransform | ( | const std::string & | target_frame, |
const ros::Time & | target_time, | ||
const std::string & | source_frame, | ||
const ros::Time & | source_time, | ||
const std::string & | fixed_frame, | ||
const ros::Duration | timeout | ||
) | const [virtual] |
Get the transform between two frames by frame ID assuming fixed frame.
target_frame | The frame to which data should be transformed |
target_time | The time to which the data should be transformed. (0 will get the latest) |
source_frame | The frame where the data originated |
source_time | The time at which the source_frame should be evaluated. (0 will get the latest) |
fixed_frame | The frame in which to assume the transform is constant in time. |
timeout | How long to block before failing |
Possible exceptions tf2::LookupException, tf2::ConnectivityException, tf2::ExtrapolationException, tf2::InvalidArgumentException
Implements tf2_ros::BufferInterface.
Definition at line 63 of file buffer.cpp.