15 #include <geometry_msgs/TransformStamped.h> 69 bool ok()
const override;
76 bool canTransform(const ::std::string& target_frame, const ::std::string& source_frame,
77 const ::ros::Time& time, ::
ros::Duration timeout, ::std::string* errstr)
const override;
87 bool canTransform(const ::std::string& target_frame, const ::std::string& source_frame,
90 bool canTransform(const ::std::string& target_frame, const ::ros::Time& target_time,
91 const ::std::string& source_frame, const ::ros::Time& source_time,
93 ::std::string* errstr)
const override;
105 bool canTransform(const ::std::string& target_frame, const ::ros::Time& target_time,
106 const ::std::string& source_frame, const ::ros::Time& source_time,
107 const ::std::string& fixed_frame, ::
ros::Duration timeout)
const;
110 const ::std::string& target_frame, const ::std::string& source_frame,
111 const ::ros::Time& time, const ::ros::Duration timeout)
const override;
114 const ::std::string& target_frame, const ::ros::Time& target_time,
115 const ::std::string& source_frame, const ::ros::Time& source_time,
116 const ::std::string& fixed_frame, const ::ros::Duration timeout)
const override;
161 return ::tf2_ros::Buffer::transform(in, out, target_frame, timeout);
179 return ::tf2_ros::Buffer::transform(in, target_frame, timeout);
199 template <
class A,
class B>
202 return ::tf2_ros::Buffer::transform(in, out, target_frame, timeout);
221 T&
transform(
const T& in, T& out, const ::std::string& target_frame, const ::ros::Time& target_time,
222 const ::std::string& fixed_frame, ::
ros::Duration timeout = {0, 0})
const 224 return ::tf2_ros::Buffer::transform(in, out, target_frame, target_time, fixed_frame, timeout);
244 T
transform(
const T& in, const ::std::string& target_frame, const ::ros::Time& target_time,
245 const ::std::string& fixed_frame, ::
ros::Duration timeout = {0, 0})
const 247 return ::tf2_ros::Buffer::transform(in, target_frame, target_time, fixed_frame, timeout);
271 template <
class A,
class B>
272 B&
transform(
const A& in, B& out, const ::std::string& target_frame, const ::ros::Time& target_time,
273 const ::std::string& fixed_frame, ::
ros::Duration timeout = {0, 0})
const 275 return ::tf2_ros::Buffer::transform(in, out, target_frame, target_time, fixed_frame, timeout);
298 bool setTransform(const ::geometry_msgs::TransformStamped&
transform, const ::std::string& authority,
299 bool is_static =
false);
310 ::geometry_msgs::TransformStamped
lookupTransform(const ::std::string& target_frame,
311 const ::std::string& source_frame, const ::ros::Time& time)
const;
324 ::geometry_msgs::TransformStamped
lookupTransform(const ::std::string& target_frame, const ::ros::Time& target_time,
325 const ::std::string& source_frame, const ::ros::Time& source_time, const ::std::string& fixed_frame)
const;
335 bool canTransform(const ::std::string& target_frame, const ::std::string& source_frame, const ::ros::Time& time,
336 ::std::string* error_msg =
nullptr)
const;
348 bool canTransform(const ::std::string& target_frame, const ::ros::Time& target_time,
349 const ::std::string& source_frame, const ::ros::Time& source_time, const ::std::string& fixed_frame,
350 ::std::string* error_msg =
nullptr)
const;
369 const ::std::shared_ptr<::tf2::BufferCore> parentBuffer {
nullptr};
bool setMinPollingDuration(const ::ros::Duration &duration)
Set minimum duration of a pause between two transform polls.
void clear()
Clear all data.
double canTransformPollingScale
canTransform() timeout is multiplied by this scale and polling for the transform is done in these tim...
Provides overrides of canTransform() that can be interrupted. Normally, canTransform() waits until tr...
mutable ::cras::ReverseSemaphore callbackSemaphore
Reverse semaphore guarding that the object is not destroyed before all pending callbacks finish...
bool setCanTransformPollingScale(double scale)
Set the scale by which canTransform() timeout is multiplied to determine the transform polling rate...
const ::std::shared_ptr<::tf2::BufferCore > parentBuffer
If not null, this class relays all lookups to parentBuffer.
bool isOk
True until requestStop() is called.
Implementation of a reversed semaphore usable for thread synchronization.
B & transform(const A &in, B &out, const ::std::string &target_frame, const ::ros::Time &target_time, const ::std::string &fixed_frame, ::ros::Duration timeout={0, 0}) const
Transform an input into the target frame and convert to a specified output type (advanced). It is templated on two types: the type of the input object and the type of the transformed output. For example, the template type could be a Transform, Pose, Vector, or Quaternion message type (as defined in geometry_msgs). The function will calculate the transformation and then convert the result into the specified output type. Compilation will fail if a known conversion does not exist bewteen the two template parameters. This function follows the advanced API, which allows transforming between different time points, and specifying a fixed frame that does not varying in time.
::ros::Duration getCacheLength()
Get the duration over which this transformer will cache.
::geometry_msgs::TransformStamped lookupTransform(const ::std::string &target_frame, const ::std::string &source_frame, const ::ros::Time &time, const ::ros::Duration timeout) const override
::std::string allFramesAsString() const
A way to see what frames have been cached. Useful for debugging.
bool ok() const override
Whether it is OK to continue. If false, all pending lookups should stop as soon as possible...
~InterruptibleTFBuffer() override
Destroys the class. Waits until a running canTransform() call is finished.
B & transform(const A &in, B &out, const ::std::string &target_frame, ::ros::Duration timeout={0, 0}) const
Transform an input into the target frame and convert to a specified output type. It is templated on t...
Object implementing an ok() method that can interrupt pending sleeps when it returns false...
const ::std::shared_ptr<::cras::InterruptibleTFBuffer > interruptibleParentBuffer
If parentBuffer is set and it is an InterruptibleTFBuffer, its dynamic cast to this type is stored he...
bool canTransform(const ::std::string &target_frame, const ::std::string &source_frame, const ::ros::Time &time, ::ros::Duration timeout, ::std::string *errstr) const override
T & transform(const T &in, T &out, const ::std::string &target_frame, ::ros::Duration timeout={0, 0}) const
Transform an input into the target frame. This function is templated and can take as input any valid ...
static const int DEFAULT_CACHE_TIME
T transform(const T &in, const ::std::string &target_frame, ::ros::Duration timeout={0, 0}) const
Transform an input into the target frame. This function is templated and can take as input any valid ...
::tf2::BufferCore & getRawBuffer()
Get the raw tf2::BufferCore that actually stores the transforms.
InterruptibleTFBuffer(const ::ros::Duration &cacheTime={::tf2::BufferCore::DEFAULT_CACHE_TIME, 0})
Create the buffer.
T transform(const T &in, const ::std::string &target_frame, const ::ros::Time &target_time, const ::std::string &fixed_frame, ::ros::Duration timeout={0, 0}) const
Transform an input into the target frame (advanced). This function is templated and can take as input...
::std::string allFramesAsYAML() const
Backwards compatibility for #84.
virtual void requestStop()
Request all pending lookups to stop. After calling this, ok() should return false.
bool setTransform(const ::geometry_msgs::TransformStamped &transform, const ::std::string &authority, bool is_static=false)
Add transform information to the tf data structure.
Interface to an object whose sleep() calls can be interrupted externally. Multiple sleep() calls can ...
T & transform(const T &in, T &out, const ::std::string &target_frame, const ::ros::Time &target_time, const ::std::string &fixed_frame, ::ros::Duration timeout={0, 0}) const
Transform an input into the target frame (advanced). This function is templated and can take as input...
::ros::Duration minPollingDuration
Minimum duration of a pause between two transform polls. If timeout * canTransformPollingScale would ...