Skip to main content

CuJointPlannerTask

Struct CuJointPlannerTask 

Source
pub struct CuJointPlannerTask<P, const N: usize, const M: usize = N> { /* private fields */ }
Expand description

Anytime planning task (CuAnytimeTask) over any CuJointPlanner.

base() starts a job from the request and runs base_budget work units; each refine() runs refine_budget more. The output only changes when the path cost strictly improves, so the published quality is monotone. Failures (invalid start or goal, invalid request, exhausted search, capacity) are published as a CuJointPlanPath without waypoints whose status names the reason, and the job aborts.

Node config: CuJointPlannerParams. The job seed comes from the task’s rng resource; deterministic planners ignore it. Each planner has a task alias (CuJointRrtConnectTask<N, M = N>, …), so RON names it directly.

Implementations§

Source§

impl<P: CuJointPlanner<N, M>, const N: usize, const M: usize> CuJointPlannerTask<P, N, M>

Source

pub fn from_planner( planner: P, base_budget: u32, refine_budget: u32, base_seed: u64, ) -> CuResult<Self>

Wraps planner with explicit positive work budgets and a base seed.

Source

pub fn from_params( params: CuJointPlannerParams<P::Params, N, M>, base_seed: u64, ) -> CuResult<Self>

Builds the planner from params (robot models, planner parameters, budgets with per-planner defaults) and wraps it with base_seed.

Source

pub const fn planner(&self) -> &P

The wrapped planner.

Source

pub const fn status(&self) -> CuPlanStatus

Status of the current job.

Source

pub fn debug_state(&self) -> CuJointPlannerDebugState

Compact snapshot of the current job’s progress.

Trait Implementations§

Source§

impl<P, const N: usize, const M: usize> CuAnytimeTask for CuJointPlannerTask<P, N, M>
where P: CuJointPlanner<N, M> + Send + Sync + 'static,

Source§

type Input<'m> = CuStampedData<CuJointPlanRequest<N>, CuMsgMetadata>

Source§

type Output<'m> = CuStampedData<CuJointPlanPath<N>, CuMsgMetadata>

Source§

type Resources<'r> = Resources

Resources required by the task.
Source§

type Quality = Ratio

Measure reported through [AnytimeStatus]: [Quality] for tasks that can score their result, () for tasks that cannot. A quality target can only be configured for tasks whose Quality is comparable to it, so a target on a () task is rejected at compile time.
Source§

fn register_debug_state_types(registry: &mut TypeRegistry)

Registers the reflected type used as this task’s debug-state contract. Read more
Source§

fn debug_state_type_path() -> &'static str

Returns the reflected type path used as this task’s debug-state schema.
Source§

fn with_debug_state<R>(&self, f: impl FnOnce(&dyn Reflect) -> R) -> R

Borrows this task’s current debug-state view. Read more
Source§

fn new( config: Option<&ComponentConfig>, resources: Self::Resources<'_>, ) -> CuResult<Self>

Here you need to initialize everything your task will need for the duration of its lifetime. The config allows you to access the configuration of the task.
Source§

fn base<'i, 'o>( &mut self, _ctx: &CuContext, input: &Self::Input<'i>, output: &mut Self::Output<'o>, ) -> CuResult<AnytimeStatus<Quality>>

Starts a new job and writes its minimum valid result into output. Read more
Source§

fn refine<'o>( &mut self, _ctx: &CuContext, output: &mut Self::Output<'o>, ) -> CuResult<AnytimeStatus<Quality>>

Performs exactly one bounded refinement quantum. Read more
§

fn start(&mut self, _ctx: &CuContext) -> Result<(), CuError>

Start is called between the creation of the task and the first call to pre/base.
§

fn preprocess(&mut self, _ctx: &CuContext) -> Result<(), CuError>

This is a method called by the runtime before “base”. This is a kind of best effort, as soon as possible call to give a chance for the task to do some work before to prepare to make “base” as short as possible.
§

fn postprocess(&mut self, _ctx: &CuContext) -> Result<(), CuError>

This is a method called by the runtime after the job’s refinement window has closed. It is best effort a chance for the task to update some state out of the critical path, for example to release scratch memory or maintain statistics that are not time-critical for the robot.
§

fn stop(&mut self, _ctx: &CuContext) -> Result<(), CuError>

Called to stop the task. It signals that base/refine won’t be called until start is called again.
Source§

impl<P, const N: usize, const M: usize> Freezable for CuJointPlannerTask<P, N, M>

Source§

fn freeze<E: Encoder>(&self, encoder: &mut E) -> Result<(), EncodeError>

This method is called by the framework when it wants to save the task state. The default implementation is to encode nothing (stateless). If you have a state, you need to implement this method.
Source§

fn thaw<D: Decoder>(&mut self, decoder: &mut D) -> Result<(), DecodeError>

This method is called by the framework when it wants to restore the task to a specific state. Here it is similar to Decode but the framework will give you a new instance of the task (the new method will be called)
Source§

impl<P, const N: usize, const M: usize> TypePath for CuJointPlannerTask<P, N, M>

§

fn type_path() -> &'static str

§

fn short_type_path() -> &'static str

§

fn type_ident() -> Option<&'static str>

§

fn crate_name() -> Option<&'static str>

§

fn module_path() -> Option<&'static str>

Auto Trait Implementations§

§

impl<P, const N: usize, const M: usize> Freeze for CuJointPlannerTask<P, N, M>
where P: Freeze,

§

impl<P, const N: usize, const M: usize> RefUnwindSafe for CuJointPlannerTask<P, N, M>
where P: RefUnwindSafe,

§

impl<P, const N: usize, const M: usize> Send for CuJointPlannerTask<P, N, M>
where P: Send,

§

impl<P, const N: usize, const M: usize> Sync for CuJointPlannerTask<P, N, M>
where P: Sync,

§

impl<P, const N: usize, const M: usize> Unpin for CuJointPlannerTask<P, N, M>
where P: Unpin,

§

impl<P, const N: usize, const M: usize> UnsafeUnpin for CuJointPlannerTask<P, N, M>
where P: UnsafeUnpin,

§

impl<P, const N: usize, const M: usize> UnwindSafe for CuJointPlannerTask<P, N, M>
where P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> GetTypeRegistration for T

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> PayloadDefaultHandlePolicyApply for T
where T: ?Sized,

§

fn apply_handle_content_policy(&self, _mode: HandleContent)

§

impl<T> PayloadDefaultLoggingPolicy for T
where T: ?Sized,

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> Reflect for T
where T: 'static,

§

impl<T> ReflectTypePath for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V