MoveIt Pro API
Core Behaviors for MoveIt Pro
Loading...
Searching...
No Matches
moveit_pro::behaviors::BreakpointSubscriber Class Referencefinal

A behavior that subscribes to a topic that can be used for pausing an objective during execution to allow introspection. This behavior will listen on the configured topic for a True/False message which will cause it to continue or abort from a breakpoint that is included in an objective. More...

#include <breakpoint_subscriber.hpp>

Inheritance diagram for moveit_pro::behaviors::BreakpointSubscriber:
Collaboration diagram for moveit_pro::behaviors::BreakpointSubscriber:

Public Member Functions

 BreakpointSubscriber (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources)
 
 BreakpointSubscriber (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources, std::unique_ptr< SubscriberInterface< std_msgs::msg::Bool > > subscriber_interface, std::unique_ptr< PublisherInterfaceBase< moveit_studio_agent_msgs::msg::BreakpointStatus > > encountered_publisher_interface, std::unique_ptr< PublisherInterfaceBase< moveit_studio_agent_msgs::msg::BreakpointStatus > > resumed_publisher_interface)
 Constructor with injected interfaces for testing.
 
- Public Member Functions inherited from moveit_pro::behaviors::AsyncBehaviorBase
 AsyncBehaviorBase (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources)
 
 ~AsyncBehaviorBase () override=default
 
BT::NodeStatus onStart () override
 Required implementation of BT::StatefulActionNode::onStart().
 
BT::NodeStatus onRunning () override
 Required implementation of BT::StatefulActionNode::onRunning().
 
void onHalted () override
 Required implementation of BT::StatefulActionNode::onHalted().
 
void resetStatus ()
 Resets the internal status of this node.
 
void notifyCanHalt ()
 Called when runAsync() finishes to notify onHalted() that the async process has finished.
 
- Public Member Functions inherited from moveit_pro::behaviors::SharedResourcesNode< BT::StatefulActionNode >
 SharedResourcesNode (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &behavior_context)
 Constructor for SharedResourcesNode. Called by BT::BehaviorTreeFactory when creating a new behavior tree containing this node.
 
const std::shared_ptr< BehaviorContext > & getBehaviorContext () const
 

Static Public Member Functions

static BT::PortsList providedPorts ()
 
static BT::KeyValueVector metadata ()
 

Detailed Description

A behavior that subscribes to a topic that can be used for pausing an objective during execution to allow introspection. This behavior will listen on the configured topic for a True/False message which will cause it to continue or abort from a breakpoint that is included in an objective.

Data Port Name Port Type Object Type
breakpoint_topic Input std::string
message Input std::string

The optional message port lets the objective author surface a human-readable hint describing why this breakpoint exists. It is published on /breakpoint_encountered alongside the topic name so the UI can display it under the breakpoint prompt.

Note
IMPORTANT: The breakpoint subscriber has QoS settings of reliable so the publisher to continue or abort is required to match those settings.
EXAMPLE: To continue from a breakpoint on the topic /breakpoint_topic_name the user can enter the following in a terminal to continue. If the value of data is False then the objective will be aborted. ros2 topic pub -1 /breakpoint_topic_name std_msgs/msg/Bool "{data: True}"

Constructor & Destructor Documentation

◆ BreakpointSubscriber() [1/2]

moveit_pro::behaviors::BreakpointSubscriber::BreakpointSubscriber ( const std::string &  name,
const BT::NodeConfiguration &  config,
const std::shared_ptr< BehaviorContext > &  shared_resources 
)

◆ BreakpointSubscriber() [2/2]

moveit_pro::behaviors::BreakpointSubscriber::BreakpointSubscriber ( const std::string &  name,
const BT::NodeConfiguration &  config,
const std::shared_ptr< BehaviorContext > &  shared_resources,
std::unique_ptr< SubscriberInterface< std_msgs::msg::Bool > >  subscriber_interface,
std::unique_ptr< PublisherInterfaceBase< moveit_studio_agent_msgs::msg::BreakpointStatus > >  encountered_publisher_interface,
std::unique_ptr< PublisherInterfaceBase< moveit_studio_agent_msgs::msg::BreakpointStatus > >  resumed_publisher_interface 
)

Constructor with injected interfaces for testing.

Member Function Documentation

◆ metadata()

BT::KeyValueVector moveit_pro::behaviors::BreakpointSubscriber::metadata ( )
static

◆ providedPorts()

BT::PortsList moveit_pro::behaviors::BreakpointSubscriber::providedPorts ( )
static

The documentation for this class was generated from the following files: