|
MoveIt Pro API
Core Behaviors for MoveIt Pro
|
One-shot subscriber interface that receives a single message from a topic, then cleans up. More...
#include <subscriber_interface.hpp>

Public Member Functions | |
| virtual | ~SubscriberInterface ()=default |
| virtual 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, bool bypass_qos_negotiation=false)=0 |
| Initialize the subscriber interface. | |
| virtual std::future< tl::expected< MessageT, std::string > > | getNextMessage ()=0 |
| Get a future for the next message through the subscriber interface. | |
| virtual tl::expected< MessageT, std::string > | syncGetNextMessage ()=0 |
| Get the next message through the subscriber interface (blocking). | |
| virtual void | halt ()=0 |
| Called to stop any long running processes. | |
One-shot subscriber interface that receives a single message from a topic, then cleans up.
Lifecycle:
initialize() — creates the subscription and optionally waits for a publisher.syncGetNextMessage() — blocks until the subscription callback fires (or times out). Returns the message.Thread safety: initialize() and syncGetNextMessage() must be called synchronously from the same thread. halt() can be called from a separate thread (e.g., the Behavior Tree executor) to cancel a blocking wait.
This interface can be easily mocked for testing to avoid needing to spin ROS nodes in tests.
| MessageT | ROS message type used to specialize this interface. |
|
virtualdefault |
|
pure virtual |
Get a future for the next message through the subscriber interface.
Implemented in moveit_pro::behaviors::RclcppSubscriberInterface< MessageT >.
|
pure virtual |
Called to stop any long running processes.
Implemented in moveit_pro::behaviors::RclcppSubscriberInterface< MessageT >.
|
pure virtual |
Initialize the subscriber interface.
| topic_name | Name of the topic to use in the subscriber interface. |
| wait_for_message_timeout | Message timeout duration to use in the subscriber interface. |
| wait_for_publisher_timeout | Publisher timeout duration to use in the subscriber interface. |
| bypass_qos_negotiation | If true, use default QoS instead of negotiating with publisher. |
Implemented in moveit_pro::behaviors::RclcppSubscriberInterface< MessageT >.
|
pure virtual |
Get the next message through the subscriber interface (blocking).
Implemented in moveit_pro::behaviors::RclcppSubscriberInterface< MessageT >.