tf2
master
tf2 maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time.
|
Go to the documentation of this file.
32 #ifndef TF2__BUFFER_CORE_H_
33 #define TF2__BUFFER_CORE_H_
42 #include <unordered_map>
47 #include "geometry_msgs/msg/transform_stamped.hpp"
110 void clear()
override;
120 const geometry_msgs::msg::TransformStamped & transform,
121 const std::string & authority,
bool is_static =
false);
135 geometry_msgs::msg::TransformStamped
153 geometry_msgs::msg::TransformStamped
257 return lookupFrameNumber(frameid_str);
262 return lookupOrInsertFrameNumber(frameid_str);
271 return getLatestCommonTime(target_frame, source_frame, time, error_string);
276 const char * function_name_arg,
279 return validateFrameId(function_name_arg, frame_id);
316 V_TimeCacheInterface frames_;
323 M_StringToCompactFrameID frameIDs_;
333 typedef uint32_t TransformableCallbackHandle;
337 M_TransformableCallback transformable_callbacks_;
338 uint32_t transformable_callbacks_counter_;
341 struct TransformableRequest
345 TransformableCallbackHandle cb_handle;
352 V_TransformableRequest transformable_requests_;
354 uint64_t transformable_requests_counter_;
359 bool setTransformImpl(
363 void lookupTransformImpl(
367 void lookupTransformImpl(
392 const char * function_name_arg,
406 const char * function_name_arg,
418 void createConnectivityErrorString(
441 void testTransformableRequests();
443 bool canTransformInternal(
447 bool canTransformNoLock(
453 bool using_dedicated_thread_;
457 #endif // TF2__BUFFER_CORE_H_
tf2::Duration getCacheLength()
Get the duration over which this transformer will cache.
Definition: buffer_core.h:284
void setUsingDedicatedThread(bool value)
Definition: buffer_core.h:228
std::shared_ptr< TimeCacheInterface > TimeCacheInterfacePtr
Definition: buffer_core.h:60
void _chainAsVector(const std::string &target_frame, TimePoint target_time, const std::string &source_frame, TimePoint source_time, const std::string &fixed_frame, std::vector< std::string > &output) const
Backwards compatabilityA way to see what frames are in a chain Useful for debugging.
bool setTransform(const geometry_msgs::msg::TransformStamped &transform, const std::string &authority, bool is_static=false)
Add transform information to the tf data structure.
std::chrono::nanoseconds Duration
Definition: time.h:40
CompactFrameID _validateFrameId(const char *function_name_arg, const std::string &frame_id) const
Definition: buffer_core.h:275
Interface for providing coordinate transforms between any two frames in a system.
Definition: buffer_core_interface.h:48
static const uint32_t MAX_GRAPH_DEPTH
< Maximum graph search depth (deeper graphs will be assumed to have loops)
Definition: buffer_core.h:95
std::pair< TimePoint, CompactFrameID > P_TimeAndFrameID
Definition: buffer_core.h:56
std::string allFramesAsYAML() const
bool canTransform(const std::string &target_frame, const std::string &source_frame, const TimePoint &time, std::string *error_msg=NULL) const override
Test if a transform is possible.
std::vector< std::string > getAllFrameNames() const override
Get all frames that exist in the system.
BufferCore(tf2::Duration cache_time_=BUFFER_CORE_DEFAULT_CACHE_TIME)
CompactFrameID _lookupFrameNumber(const std::string &frameid_str) const
Definition: buffer_core.h:255
uint32_t CompactFrameID
Definition: transform_storage.h:40
@ TransformFailure
Definition: buffer_core.h:65
std::string allFramesAsString() const
A way to see what frames have been cached Useful for debugging.
std::chrono::time_point< std::chrono::system_clock, Duration > TimePoint
Definition: time.h:41
void _getFrameStrings(std::vector< std::string > &ids) const
A way to get a std::vector of available frame ids.
uint64_t TransformableRequestHandle
Definition: buffer_core.h:57
bool isUsingDedicatedThread() const
Definition: buffer_core.h:231
std::string _allFramesAsDot() const
Definition: time_cache.h:47
bool _frameExists(const std::string &frame_id_str) const
Check if a frame exists in the tree.
void cancelTransformableRequest(TransformableRequestHandle handle)
Internal use only.
geometry_msgs::msg::TransformStamped lookupTransform(const std::string &target_frame, const std::string &source_frame, const TimePoint &time) const override
Get the transform between two frames by frame ID.
bool _getParent(const std::string &frame_id, TimePoint time, std::string &parent) const
Fill the parent of a frame.
std::function< void(TransformableRequestHandle request_handle, const std::string &target_frame, const std::string &source_frame, TimePoint time, TransformableResult result)> TransformableCallback
Definition: buffer_core.h:211
CompactFrameID _lookupOrInsertFrameNumber(const std::string &frameid_str)
Definition: buffer_core.h:260
TF2Error
Definition: exceptions.h:43
A Class which provides coordinate transforms between any two frames in a system.
Definition: buffer_core.h:89
void clear() override
Clear all data.
Definition: buffer_core.h:53
#define TF2_PUBLIC
Definition: visibility_control.h:57
virtual ~BufferCore(void)
tf2::TF2Error _getLatestCommonTime(CompactFrameID target_frame, CompactFrameID source_frame, TimePoint &time, std::string *error_string) const
Definition: buffer_core.h:266
TransformableResult
Definition: buffer_core.h:62
TransformableRequestHandle addTransformableRequest(const TransformableCallback &cb, const std::string &target_frame, const std::string &source_frame, TimePoint time)
Internal use only.
@ TransformAvailable
Definition: buffer_core.h:64