pub struct PeerTriangulation3dTask<const SNAPSHOT_N: usize, const ANCHOR_N: usize> { /* private fields */ }Implementations§
Source§impl<const SNAPSHOT_N: usize, const ANCHOR_N: usize> PeerTriangulation3dTask<SNAPSHOT_N, ANCHOR_N>
impl<const SNAPSHOT_N: usize, const ANCHOR_N: usize> PeerTriangulation3dTask<SNAPSHOT_N, ANCHOR_N>
pub fn new_with_anchors( anchors: &[PeerAnchor3d], max_rms_residual: Option<Length>, ) -> Result<Self, PeerTriangulationError>
pub fn estimate( &self, snapshot: &PeerRangeSnapshot<SNAPSHOT_N>, ) -> Result<Option<LocalPosition3d>, PeerTriangulationError>
Trait Implementations§
Source§impl<const SNAPSHOT_N: usize, const ANCHOR_N: usize> CuTask for PeerTriangulation3dTask<SNAPSHOT_N, ANCHOR_N>
impl<const SNAPSHOT_N: usize, const ANCHOR_N: usize> CuTask for PeerTriangulation3dTask<SNAPSHOT_N, ANCHOR_N>
type Input<'m> = CuStampedData<PeerRangeSnapshot<SNAPSHOT_N>, CuMsgMetadata>
type Output<'m> = CuStampedData<LocalPosition3d, CuMsgMetadata>
Source§fn new(
config: Option<&ComponentConfig>,
_resources: Self::Resources<'_>,
) -> CuResult<Self>where
Self: Sized,
fn new(
config: Option<&ComponentConfig>,
_resources: Self::Resources<'_>,
) -> CuResult<Self>where
Self: Sized,
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(
&mut self,
_ctx: &CuContext,
input: &Self::Input<'_>,
output: &mut Self::Output<'_>,
) -> CuResult<()>
fn process( &mut self, _ctx: &CuContext, input: &Self::Input<'_>, output: &mut Self::Output<'_>, ) -> 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.
Source§fn register_debug_state_types(registry: &mut TypeRegistry)where
Self: Sized + GetTypeRegistration,
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
Source§fn debug_state_type_path() -> &'static str
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 + 'static)) -> R,
) -> Rwhere
Self: Sized,
fn with_debug_state<R>(
&self,
f: impl FnOnce(&(dyn Reflect + 'static)) -> R,
) -> Rwhere
Self: Sized,
Borrows this task’s current debug-state view. Read more
Source§fn start(&mut self, _ctx: &CuContext) -> Result<(), CuError>
fn start(&mut self, _ctx: &CuContext) -> Result<(), CuError>
Start is called between the creation of the task and the first call to pre/process.
Source§fn preprocess(&mut self, _ctx: &CuContext) -> Result<(), CuError>
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.
Source§fn postprocess(&mut self, _ctx: &CuContext) -> Result<(), CuError>
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.
Source§impl<const SNAPSHOT_N: usize, const ANCHOR_N: usize> Freezable for PeerTriangulation3dTask<SNAPSHOT_N, ANCHOR_N>
impl<const SNAPSHOT_N: usize, const ANCHOR_N: usize> Freezable for PeerTriangulation3dTask<SNAPSHOT_N, ANCHOR_N>
Source§fn freeze<E>(&self, encoder: &mut E) -> Result<(), EncodeError>where
E: Encoder,
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.
Source§fn thaw<D>(&mut self, _decoder: &mut D) -> Result<(), DecodeError>where
D: Decoder,
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)
Auto Trait Implementations§
impl<const SNAPSHOT_N: usize, const ANCHOR_N: usize> Freeze for PeerTriangulation3dTask<SNAPSHOT_N, ANCHOR_N>
impl<const SNAPSHOT_N: usize, const ANCHOR_N: usize> RefUnwindSafe for PeerTriangulation3dTask<SNAPSHOT_N, ANCHOR_N>
impl<const SNAPSHOT_N: usize, const ANCHOR_N: usize> Send for PeerTriangulation3dTask<SNAPSHOT_N, ANCHOR_N>
impl<const SNAPSHOT_N: usize, const ANCHOR_N: usize> Sync for PeerTriangulation3dTask<SNAPSHOT_N, ANCHOR_N>
impl<const SNAPSHOT_N: usize, const ANCHOR_N: usize> Unpin for PeerTriangulation3dTask<SNAPSHOT_N, ANCHOR_N>
impl<const SNAPSHOT_N: usize, const ANCHOR_N: usize> UnsafeUnpin for PeerTriangulation3dTask<SNAPSHOT_N, ANCHOR_N>
impl<const SNAPSHOT_N: usize, const ANCHOR_N: usize> UnwindSafe for PeerTriangulation3dTask<SNAPSHOT_N, ANCHOR_N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> GetTypeRegistration for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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