Class TransformListener

Inheritance Relationships

Derived Type

Class Documentation

class TransformListener

This class provides an easy way to request and receive coordinate frame transform information.

Subclassed by tf2_ros::StaticTransformListener

Public Types

using NodeBaseInterface = rclcpp::node_interfaces::NodeBaseInterface
using NodeLoggingInterface = rclcpp::node_interfaces::NodeLoggingInterface
using NodeParametersInterface = rclcpp::node_interfaces::NodeParametersInterface
using NodeTopicsInterface = rclcpp::node_interfaces::NodeTopicsInterface
using RequiredInterfaces = rclcpp::node_interfaces::NodeInterfaces<NodeBaseInterface, NodeLoggingInterface, NodeParametersInterface, NodeTopicsInterface>

Public Functions

explicit TF2_ROS_PUBLIC TransformListener(tf2::BufferCore &buffer, bool spin_thread = true, bool static_only = false)

Simplified constructor for transform listener.

This constructor will create a new ROS 2 node under the hood. If you already have access to a ROS 2 node and you want to associate the TransformListener to it, then it’s recommended to use one of the other constructors.

template<class AllocatorT = std::allocator<void>>
inline TransformListener(tf2::BufferCore &buffer, RequiredInterfaces node_interfaces, bool spin_thread = true, const rclcpp::QoS &qos = DynamicListenerQoS(), const rclcpp::QoS &static_qos = StaticListenerQoS(), const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT> &options = detail::get_default_transform_listener_sub_options<AllocatorT>(), const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT> &static_options = detail::get_default_transform_listener_static_sub_options<AllocatorT>(), bool static_only = false)

NodeInterfaces constructor.

template<class NodeT, class AllocatorT = std::allocator<void>, std::enable_if_t<rcpputils::is_pointer<NodeT>::value, bool> = true>
inline TransformListener(tf2::BufferCore &buffer, NodeT &&node, bool spin_thread = true, const rclcpp::QoS &qos = DynamicListenerQoS(), const rclcpp::QoS &static_qos = StaticListenerQoS(), const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT> &options = detail::get_default_transform_listener_sub_options<AllocatorT>(), const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT> &static_options = detail::get_default_transform_listener_static_sub_options<AllocatorT>(), bool static_only = false)

Node constructor.

template<class AllocatorT = std::allocator<void>>
inline TransformListener(tf2::BufferCore &buffer, NodeBaseInterface::SharedPtr node_base, NodeLoggingInterface::SharedPtr node_logging, NodeParametersInterface::SharedPtr node_parameters, NodeTopicsInterface::SharedPtr node_topics, bool spin_thread = true, const rclcpp::QoS &qos = DynamicListenerQoS(), const rclcpp::QoS &static_qos = StaticListenerQoS(), const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT> &options = detail::get_default_transform_listener_sub_options<AllocatorT>(), const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT> &static_options = detail::get_default_transform_listener_static_sub_options<AllocatorT>(), bool static_only = false)

Node interface constructor.

virtual TF2_ROS_PUBLIC ~TransformListener()
virtual TF2_ROS_PUBLIC void subscription_callback (tf2_msgs::msg::TFMessage::ConstSharedPtr msg, bool is_static)

Callback function for ros message subscription.