Documentation ¶
Overview ¶
Package state provides apis for motion builtin plan executions and manages the state of those executions
Index ¶
- func StartExecution[R any](ctx context.Context, s *State, componentName resource.Name, req R, ...) (motion.ExecutionID, error)
- type ExecuteResponse
- type PlanExecutor
- type PlanExecutorConstructor
- type PlanResponse
- type State
- func (s *State) ListPlanStatuses(req motion.ListPlanStatusesReq) ([]motion.PlanStatusWithID, error)
- func (s *State) PlanHistory(req motion.PlanHistoryReq) ([]motion.PlanWithStatus, error)
- func (s *State) Stop()
- func (s *State) StopExecutionByResource(componentName resource.Name) error
- func (s *State) ValidateNoActiveExecutionID(name resource.Name) error
- type Waypoints
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartExecution ¶ added in v0.16.0
func StartExecution[R any]( ctx context.Context, s *State, componentName resource.Name, req R, planExecutorConstructor PlanExecutorConstructor[R], ) (motion.ExecutionID, error)
StartExecution creates a new execution from a state.
Types ¶
type ExecuteResponse ¶
type ExecuteResponse struct { // If true, the Execute function didn't reach the goal & the caller should replan Replan bool // Set if Replan is true, describes why replanning was triggered ReplanReason string }
ExecuteResponse is the response from Execute.
type PlanExecutor ¶ added in v0.16.0
type PlanExecutor interface { Plan(ctx context.Context) (PlanResponse, error) Execute(context.Context, Waypoints) (ExecuteResponse, error) }
PlanExecutor implements Plan and Execute.
type PlanExecutorConstructor ¶
type PlanExecutorConstructor[R any] func( ctx context.Context, req R, seedPlan motionplan.Plan, replanCount int, ) (PlanExecutor, error)
PlanExecutorConstructor creates a PlannerExecutor if ctx is cancelled then all PlannerExecutor interface methods must terminate & return errors req is the request that will be used during planning & execution seedPlan (nil during the first plan) is the previous plan if replanning has occurred replanCount is the number of times replanning has occurred, zero the first time planning occurs. R is a genric type which is able to be used to create a PlannerExecutor.
type PlanResponse ¶
type PlanResponse struct { Waypoints Waypoints Motionplan motionplan.Plan PosesByComponent []motion.PlanStep }
PlanResponse is the response from Plan.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State is the state of the builtin motion service It keeps track of the builtin motion service's executions.
func (*State) ListPlanStatuses ¶ added in v0.16.0
func (s *State) ListPlanStatuses(req motion.ListPlanStatusesReq) ([]motion.PlanStatusWithID, error)
ListPlanStatuses returns the status of plans created by MoveOnGlobe requests that are executing OR are part of an execution which changed it state within the a 24HR TTL OR until the robot reinitializes. If OnlyActivePlans is provided, only returns plans which are in non terminal states.
func (*State) PlanHistory ¶ added in v0.16.0
func (s *State) PlanHistory(req motion.PlanHistoryReq) ([]motion.PlanWithStatus, error)
PlanHistory returns the plans with statuses of the resource By default returns all plans from the most recent execution of the resoure If the ExecutionID is provided, returns the plans of the ExecutionID rather than the most recent execution If LastPlanOnly is provided then only the last plan is returned for the execution with the ExecutionID if it is provided, or the last execution for that component otherwise.
func (*State) StopExecutionByResource ¶ added in v0.16.0
StopExecutionByResource stops the active execution with a given resource name in the State.
type Waypoints ¶
type Waypoints [][]referenceframe.Input
Waypoints represent the waypoints of the plan.