Template Class Latest

Inheritance Relationships

Derived Type

Class Documentation

template<typename MessageT>
class Latest

Polling policy that keeps the latest received message.

This policy retains the latest received message and provides it when requested. If a new message is received, it overwrites the previously stored message.

Template Parameters:

MessageT – The message type.

Subclassed by autoware_utils_rclcpp::InterProcessPollingSubscriber< MessageT, PollingPolicy >

Public Functions

MessageT::ConstSharedPtr take_data()

Retrieve the latest data. If no new data has been received, the previously received data.

Returns:

typename MessageT::ConstSharedPtr The latest 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.