MoveIt Pro API
Core Behaviors for MoveIt Pro
Loading...
Searching...
No Matches
moveit_pro::behaviors::internal Namespace Reference

Classes

class  MPCBehaviorBase
 All non-template implementation for the templated MPCBehaviorBase class. More...
 
struct  Sam2AutomaskModelPorts
 
struct  Sam3ModelPorts
 

Enumerations

enum class  PolicyResponseOutcome { kChunkProduced , kEndOfRun , kFailed }
 

Functions

PolicyResponseOutcome classifyPolicyResponse (std::uint8_t status)
 Classify a GetActionChunk response status into the run outcome it demands.
 
std::string policyResponseFailureMessage (const moveit_pro_ml_msgs::srv::GetActionChunk::Response &response)
 Render a response classified kFailed as the run's failure reason.
 
template<typename Lockable , typename StopTransition >
void stopRecordingUnderLock (Lockable &mutex, StopTransition &&set_stopped)
 Performs the stop transition while holding the mutex shared with trajectory mutation.
 
template<typename Lockable , typename StopPredicate , typename TrajectoryMutation >
bool mutateTrajectoryUnlessStopped (Lockable &mutex, StopPredicate &&is_stopped, TrajectoryMutation &&mutate_trajectory)
 Mutates the trajectory only while the stop predicate is false under the shared mutex.
 

Enumeration Type Documentation

◆ PolicyResponseOutcome

How a policy response's status maps onto the run: execute the chunk, end the run as complete, or fail it.

Enumerator
kChunkProduced 
kEndOfRun 
kFailed 

Function Documentation

◆ classifyPolicyResponse()

PolicyResponseOutcome moveit_pro::behaviors::internal::classifyPolicyResponse ( std::uint8_t  status)

Classify a GetActionChunk response status into the run outcome it demands.

CHUNK_PRODUCED executes the chunk and NO_MORE_ACTIONS ends the run as complete; everything else fails the run: ERROR, UNKNOWN (the server never set the field), and any value the contract does not define, so only an explicit NO_MORE_ACTIONS may end a run as complete.

Parameters
statusThe response's status field.
Returns
The outcome the caller must apply.

◆ mutateTrajectoryUnlessStopped()

bool moveit_pro::behaviors::internal::mutateTrajectoryUnlessStopped ( Lockable mutex,
StopPredicate &&  is_stopped,
TrajectoryMutation &&  mutate_trajectory 
)

Mutates the trajectory only while the stop predicate is false under the shared mutex.

Returns
True when the mutation ran; false when recording had already stopped.

◆ policyResponseFailureMessage()

std::string moveit_pro::behaviors::internal::policyResponseFailureMessage ( const moveit_pro_ml_msgs::srv::GetActionChunk::Response &  response)

Render a response classified kFailed as the run's failure reason.

An unset or contract-undefined status gets its own text naming the adapter-side bug; ERROR reports the response's message as the reason.

Parameters
responseThe policy response that failed the run.
Returns
The operator-facing failure reason.

◆ stopRecordingUnderLock()

void moveit_pro::behaviors::internal::stopRecordingUnderLock ( Lockable mutex,
StopTransition &&  set_stopped 
)

Performs the stop transition while holding the mutex shared with trajectory mutation.