Template Class BasicTakeSubscription

Inheritance Relationships

Base Type

Class Documentation

template<typename MessageT, typename BridgeRequestPolicy>
class BasicTakeSubscription : public agnocast::SubscriptionBase

Public Types

using SharedPtr = std::shared_ptr<BasicTakeSubscription<MessageT, BridgeRequestPolicy>>

Public Functions

inline BasicTakeSubscription(rclcpp::Node *node, const std::string &topic_name, const rclcpp::QoS &qos, agnocast::SubscriptionOptions options = agnocast::SubscriptionOptions())
inline BasicTakeSubscription(agnocast::Node *node, const std::string &topic_name, const rclcpp::QoS &qos, agnocast::SubscriptionOptions options = agnocast::SubscriptionOptions())
inline AGNOCAST_PUBLIC agnocast::ipc_shared_ptr< const MessageT > take (bool allow_same_message=false)

Retrieve the latest message from the topic.

Parameters:

allow_same_message – If true, may return the same message as the previous call (useful for always having the latest value). If false, returns only new messages since the last take.

Returns:

Shared pointer to the message, or empty if unavailable.