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
43 #include "geometry_msgs/msg/transform_stamped.hpp"
46 #include <unordered_map>
112 void clear()
override;
121 bool setTransform(
const geometry_msgs::msg::TransformStamped& transform,
const std::string & authority,
bool is_static =
false);
135 geometry_msgs::msg::TransformStamped
152 geometry_msgs::msg::TransformStamped
299 return lookupFrameNumber(frameid_str);
303 return lookupOrInsertFrameNumber(frameid_str);
309 return getLatestCommonTime(target_frame, source_frame, time, error_string);
314 return validateFrameId(function_name_arg, frame_id);
348 V_TimeCacheInterface frames_;
355 M_StringToCompactFrameID frameIDs_;
366 M_TransformableCallback transformable_callbacks_;
367 uint32_t transformable_callbacks_counter_;
370 struct TransformableRequest
381 V_TransformableRequest transformable_requests_;
383 uint64_t transformable_requests_counter_;
385 struct RemoveRequestByCallback;
386 struct RemoveRequestByID;
421 const char* function_name_arg,
459 void testTransformableRequests();
469 bool using_dedicated_thread_;
tf2::Duration getCacheLength()
Get the duration over which this transformer will cache.
Definition: buffer_core.h:319
void setUsingDedicatedThread(bool value)
Definition: buffer_core.h:269
std::shared_ptr< TimeCacheInterface > TimeCacheInterfacePtr
Definition: buffer_core.h:63
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:44
CompactFrameID _validateFrameId(const char *function_name_arg, const std::string &frame_id) const
Definition: buffer_core.h:313
TransformableCallbackHandle addTransformableCallback(const TransformableCallback &cb)
Internal use only.
Interface for providing coordinate transforms between any two frames in a system.
Definition: buffer_core_interface.h:50
static const uint32_t MAX_GRAPH_DEPTH
Maximum graph search depth (deeper graphs will be assumed to have loops)
Definition: buffer_core.h:97
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
Lookup the twist of the tracking_frame with respect to the observation frame in the reference_frame u...
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:298
uint32_t CompactFrameID
Definition: transform_storage.h:46
@ TransformFailure
Definition: buffer_core.h:68
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:45
void _getFrameStrings(std::vector< std::string > &ids) const
A way to get a std::vector of available frame ids.
std::pair< TimePoint, CompactFrameID > P_TimeAndFrameID
Definition: buffer_core.h:58
uint64_t TransformableRequestHandle
Definition: buffer_core.h:60
bool isUsingDedicatedThread() const
Definition: buffer_core.h:272
TransformableRequestHandle addTransformableRequest(TransformableCallbackHandle handle, const std::string &target_frame, const std::string &source_frame, TimePoint time)
Internal use only.
std::string _allFramesAsDot() const
Definition: time_cache.h:48
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.
CompactFrameID _lookupOrInsertFrameNumber(const std::string &frameid_str)
Definition: buffer_core.h:302
TF2Error
Definition: exceptions.h:42
A Class which provides coordinate transforms between any two frames in a system.
Definition: buffer_core.h:92
void clear() override
Clear all data.
Definition: buffer_core.h:55
#define TF2_PUBLIC
Definition: visibility_control.h:58
virtual ~BufferCore(void)
void removeTransformableCallback(TransformableCallbackHandle handle)
Internal use only.
tf2::TF2Error _getLatestCommonTime(CompactFrameID target_frame, CompactFrameID source_frame, TimePoint &time, std::string *error_string) const
Definition: buffer_core.h:307
TransformableResult
Definition: buffer_core.h:65
uint32_t TransformableCallbackHandle
Definition: buffer_core.h:59
@ TransformAvailable
Definition: buffer_core.h:67