class mola::TransformTreeSource
Overview
Mixin interface for modules that track a tree of coordinate frames (ROS “/tf” and “/tf_static”, or an equivalent), and can expose snapshots of it to other MOLA modules: dataset readers, live sensor bridges, etc.
Consumers detect it the same way they detect a NavStateFilter (ExecutableBase::findService<TransformTreeSource>()). Note that this interface is deliberately free of any ROS/tf2 type, so mola_kernel stays independent of ROS.
Implementations are required to be thread-safe.
#include <TransformTreeSource.h> class TransformTreeSource { public: // construction TransformTreeSource(); TransformTreeSource(const TransformTreeSource&); TransformTreeSource(TransformTreeSource&&); // methods TransformTreeSource& operator = (const TransformTreeSource&); TransformTreeSource& operator = (TransformTreeSource&&); virtual std::optional<TransformTree> transform_tree( const std::string& root, const std::optional<mrpt::Clock::time_point>& timestamp = std::nullopt ) const = 0; virtual std::string transform_tree_default_root() const; }; // direct descendants class BridgeROS2; class Rosbag2Dataset;
Methods
virtual std::optional<TransformTree> transform_tree( const std::string& root, const std::optional<mrpt::Clock::time_point>& timestamp = std::nullopt ) const = 0
Returns all frames reachable below root (that is, the subtree it is the root of), with their poses resolved with respect to it.
Filtering happens here, in the source, since it is what owns the underlying transform buffer: a consumer interested in a robot’s joints never has to receive, nor walk, the frames of unrelated subtrees.
Parameters:
root |
The frame to use as the subtree root, e.g. “base_link”. |
timestamp |
The time to look the transforms up at. If not provided, or if no data is buffered for it, the latest available transform of each frame is used instead. |
Returns:
The subtree, or std::nullopt if root is not a known frame.
virtual std::string transform_tree_default_root() const
Returns the frame this source considers the robot’s body frame (its base_link_frame_id parameter, or equivalent), so consumers can default to it instead of hardcoding a name. Empty if the source has none.