MoveIt Pro API
Core Behaviors for MoveIt Pro
Loading...
Searching...
No Matches
moveit_pro::behaviors::ActionChunkProducerInterface Class Referenceabstract

Runs one inference of a policy that produces trajectory chunks. More...

#include <execute_policy.hpp>

Public Types

using GetActionChunk = moveit_pro_ml_msgs::srv::GetActionChunk
 

Public Member Functions

virtual ~ActionChunkProducerInterface ()=default
 
virtual tl::expected< GetActionChunk::Response, std::string > getActionChunk (const GetActionChunk::Request &request)=0
 Run one inference.
 
virtual tl::expected< void, std::string > warmup (const GetActionChunk::Request &)
 Exercise the full policy round-trip once before the run's clock starts.
 

Detailed Description

Runs one inference of a policy that produces trajectory chunks.

Hidden behind an interface so the production service client and a test double share one seam. The caller fills the request observation and real-time-chunking carryover; the producer returns the next chunk. A failed return means the call itself could not complete, which is distinct from a successful call whose response reports the policy has no more actions.

Member Typedef Documentation

◆ GetActionChunk

Constructor & Destructor Documentation

◆ ~ActionChunkProducerInterface()

virtual moveit_pro::behaviors::ActionChunkProducerInterface::~ActionChunkProducerInterface ( )
virtualdefault

Member Function Documentation

◆ getActionChunk()

virtual tl::expected< GetActionChunk::Response, std::string > moveit_pro::behaviors::ActionChunkProducerInterface::getActionChunk ( const GetActionChunk::Request &  request)
pure virtual

Run one inference.

Parameters
requestThe observation and real-time-chunking carryover for this step.
Returns
The policy response, or an error if the call could not complete.

◆ warmup()

virtual tl::expected< void, std::string > moveit_pro::behaviors::ActionChunkProducerInterface::warmup ( const GetActionChunk::Request &  )
inlinevirtual

Exercise the full policy round-trip once before the run's clock starts.

Sends one throwaway inference so the first getActionChunk() on the run timeline does not pay the cold cost of establishing the request/response path (service discovery and the transport's first-message endpoint matching, which is seconds on a fresh connection). Paid on the timeline, that cost stalls the first chunk so it lands in the controller's past with nothing to stitch, and inflates the latency estimate that places every later seam. The request is shaped like a first inference (new_episode set) and its response is discarded. The default does nothing, which suits an in-process producer with no transport to warm.

Parameters
sample_requestA representative first-inference request used only to drive the round-trip.
Returns
An error if the policy cannot be reached, otherwise success.

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