MoveIt Pro Behavior
Core Behaviors for MoveIt Pro
moveit_studio::behaviors::WaitAndPopSolutionQueue Class Referencefinal

Pops the MTC solution queue to get the next solution to be processed. More...

#include <wait_and_pop_solution_queue.hpp>

Inheritance diagram for moveit_studio::behaviors::WaitAndPopSolutionQueue:
Collaboration diagram for moveit_studio::behaviors::WaitAndPopSolutionQueue:

Public Member Functions

 WaitAndPopSolutionQueue (const std::string &name, const BT::NodeConfiguration &config)
 
BT::NodeStatus tick () override
 Read queue from the blackboard, check whether or not it is empty and pop the next solution if it is not empty. The solution will be written to the BT output port. More...
 
void halt () override
 

Static Public Member Functions

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

Detailed Description

Pops the MTC solution queue to get the next solution to be processed.

The queue will be modified in-place. If the queue is uninitialized or empty, this behavior will return RUNNING. An exception is if the value of the fail_if_queue_empty port is True, in which case it will return FAILURE.

Data Port Name Port Type Object Type
solution queue Input std::shared_ptr<std::queue<moveit_task_constructor_msgs::msg::Solution>>
solution Output moveit_task_constructor_msgs::msg::Solution
fail_if_queue_empty Input bool

Constructor & Destructor Documentation

◆ WaitAndPopSolutionQueue()

moveit_studio::behaviors::WaitAndPopSolutionQueue::WaitAndPopSolutionQueue ( const std::string &  name,
const BT::NodeConfiguration &  config 
)

Member Function Documentation

◆ halt()

void moveit_studio::behaviors::WaitAndPopSolutionQueue::halt ( )
override

◆ metadata()

BT::KeyValueVector moveit_studio::behaviors::WaitAndPopSolutionQueue::metadata ( )
static

◆ providedPorts()

BT::PortsList moveit_studio::behaviors::WaitAndPopSolutionQueue::providedPorts ( )
static

◆ tick()

BT::NodeStatus moveit_studio::behaviors::WaitAndPopSolutionQueue::tick ( )
override

Read queue from the blackboard, check whether or not it is empty and pop the next solution if it is not empty. The solution will be written to the BT output port.

Returns
BT::NodeStatus::SUCCESS if a solution was popped from the queue and set to an output port.
BT::NodeStatus::RUNNING if the queue was empty or uninitialized and fail_if_queue_empty was not set or was set to False.
BT::NodeStatus::FAILURE if the solution could not be set to the output data port.
BT::NodeStatus::FAILURE if the queue was empty or uninitialized and fail_if_queue_empty was not set or was set to True.

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