Template Class Newest

Class Documentation

template<typename MessageT>
class Newest

Polling policy that keeps the newest received message.

Template Parameters:

MessageT – The message type.

Public Functions

MessageT::ConstSharedPtr take_data()

Retrieve the newest data. If no new data has been received, nullptr is returned.

Returns:

typename MessageT::ConstSharedPtr The newest data.

Protected Functions

inline void check_qos(const rclcpp::QoS &qos)

Check the QoS settings for the subscription.

Parameters:

qos – The QoS profile to check.

Throws:

std::invalid_argument – If the QoS depth is not 1.