![]() |
MoveIt Pro API
Core Behaviors for MoveIt Pro
|
Implementation of the subscriber interface for a rclcpp subscription. More...
#include <get_message_from_topic.hpp>
Public Member Functions | |
RclcppSubscriberInterface (const std::shared_ptr< BehaviorContext > &shared_resources) | |
tl::expected< void, std::string > | initialize (const std::string &topic_name, const std::chrono::duration< double > &wait_for_message_timeout, const std::chrono::duration< double > &wait_for_publisher_timeout) override |
Initializes the rclcpp subscriber interface to listen on the provided topic. | |
tl::expected< void, std::string > | initialize (const std::string &topic_name, const std::chrono::duration< double > &wait_for_message_timeout, const std::chrono::duration< double > &wait_for_publisher_timeout, std::optional< std::function< void()> > on_haltable) |
An overloaded form of initialize with an additional callback parameter that is called when the current task can be halted. | |
tl::expected< MessageT, std::string > | syncGetNextMessage () override |
Block until a message is received on the topic. | |
void | halt () override |
Stops any publisher or message checking. | |
Implementation of the subscriber interface for a rclcpp subscription.
|
explicit |
|
overridevirtual |
Stops any publisher or message checking.
Implements moveit_studio::behaviors::GetMessageFromTopicBehaviorBase< MessageT >::SubscriberInterfaceBase.
|
overridevirtual |
Initializes the rclcpp subscriber interface to listen on the provided topic.
This blocks for a brief duration until a publisher is available on the topic. If no publisher appears before the timeout, returns an error result.
After the publisher appears, get its current QoS settings, and set the subscriber's QoS settings to have the same reliability setting as the publisher. This ensures that the subscriber QoS always matches the publisher in situations where the same behavior may need to get messages from different sources which use different QoS settings (for example, retrieving images from a simulated camera publisher vs. a real-hardware camera driver).
topic_name | The topic name to use when creating the subscriber. |
wait_for_message_timeout | The timeout duration to use when waiting for a message to be received on the topic. |
wait_for_publisher_timeout | The timeout duration to use when waiting for a publisher to advertise on the topic. |
Implements moveit_studio::behaviors::GetMessageFromTopicBehaviorBase< MessageT >::SubscriberInterfaceBase.
tl::expected< void, std::string > moveit_studio::behaviors::RclcppSubscriberInterface< MessageT >::initialize | ( | const std::string & | topic_name, |
const std::chrono::duration< double > & | wait_for_message_timeout, | ||
const std::chrono::duration< double > & | wait_for_publisher_timeout, | ||
std::optional< std::function< void()> > | on_haltable | ||
) |
An overloaded form of initialize
with an additional callback parameter that is called when the current task can be halted.
|
overridevirtual |
Block until a message is received on the topic.
Implements moveit_studio::behaviors::GetMessageFromTopicBehaviorBase< MessageT >::SubscriberInterfaceBase.