Skip to main content

CuPlanToTrajectoryTask

Struct CuPlanToTrajectoryTask 

Source
pub struct CuPlanToTrajectoryTask<const N: usize, const CAP: usize> { /* private fields */ }
Expand description

Times each published plan into a CuTrajectoryPayload<N, CAP>.

Input is a planner’s CuJointPlanPath<N>. A path with CuPlanStatus::has_path is the final result of its planning job and is timed; failure statuses and empty cycles publish nothing. A path that cannot be timed within the configured limits or the trajectory capacity CAP is an error.

Node config: CuTimingParams<N> (limits required, profile default "trapezoidal", sample_period in seconds, default 0.02):

// CuPlanToTrajectoryTask<6, 1024>
config: {
    "limits": {
        "max_velocities": [{"revolute": 0.8}, /* ... */],
        "max_accelerations": [{"revolute": 2.0}, /* ... */],
    },
    "profile": "s_curve",
    "sample_period": 0.01,
}

Timing does not recheck the interpolated trajectory for collisions; the path’s scene_revision identifies the scene it was planned against.

Implementations§

Source§

impl<const N: usize, const CAP: usize> CuPlanToTrajectoryTask<N, CAP>

Source

pub fn from_params(params: CuTimingParams<N>) -> CuResult<Self>

Creates a timing task from validated timing parameters.

Source

pub const fn params(&self) -> &CuTimingParams<N>

The timing parameters.

Trait Implementations§

Source§

impl<const N: usize, const CAP: usize> CuTask for CuPlanToTrajectoryTask<N, CAP>

Source§

type Resources<'r> = ()

Resources required by the task.
Source§

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

Source§

type Output<'m> = CuStampedData<CuTrajectoryPayload<N, CAP>, CuMsgMetadata>

Source§

fn new( cfg: 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 process<'i, 'o>( &mut self, _ctx: &CuContext, input: &Self::Input<'i>, output: &mut Self::Output<'o>, ) -> CuResult<()>

Process is the most critical execution of the task. The goal will be to produce the output message as soon as possible. Use preprocess to prepare the task to make this method as short as possible.
§

fn register_debug_state_types(registry: &mut TypeRegistry)
where Self: Sized + GetTypeRegistration,

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

fn debug_state_type_path() -> &'static str
where Self: Sized + TypePath,

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

fn with_debug_state<R>( &self, f: impl FnOnce(&(dyn Reflect + 'static)) -> R, ) -> R
where Self: Sized,

Borrows this task’s current debug-state view. 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/process.
§

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

This is a method called by the runtime before “process”. 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 “process” as short as possible.
§

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

This is a method called by the runtime after “process”. It is best effort a chance for the task to update some state after process is out of the way. It can be use for example to maintain statistics etc. that are not time-critical for the robot.
§

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

Called to stop the task. It signals that the *process method won’t be called until start is called again.
Source§

impl<const N: usize, const CAP: usize> Freezable for CuPlanToTrajectoryTask<N, CAP>

§

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

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.
§

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

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<const N: usize, const CAP: usize> TypePath for CuPlanToTrajectoryTask<N, CAP>

§

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<const N: usize, const CAP: usize> Freeze for CuPlanToTrajectoryTask<N, CAP>

§

impl<const N: usize, const CAP: usize> RefUnwindSafe for CuPlanToTrajectoryTask<N, CAP>

§

impl<const N: usize, const CAP: usize> Send for CuPlanToTrajectoryTask<N, CAP>

§

impl<const N: usize, const CAP: usize> Sync for CuPlanToTrajectoryTask<N, CAP>

§

impl<const N: usize, const CAP: usize> Unpin for CuPlanToTrajectoryTask<N, CAP>

§

impl<const N: usize, const CAP: usize> UnsafeUnpin for CuPlanToTrajectoryTask<N, CAP>

§

impl<const N: usize, const CAP: usize> UnwindSafe for CuPlanToTrajectoryTask<N, CAP>

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