pub struct ConstTransformBufferSync<T: Copy + Debug + Default + 'static, const N: usize> { /* private fields */ }
Expand description
Thread-safe constant-size transform buffer with concurrent access
Implementations§
Source§impl<T: Copy + Debug + Default + 'static, const N: usize> ConstTransformBufferSync<T, N>
impl<T: Copy + Debug + Default + 'static, const N: usize> ConstTransformBufferSync<T, N>
pub fn new() -> Self
Sourcepub fn add_transform(&self, transform: StampedTransform<T>)
pub fn add_transform(&self, transform: StampedTransform<T>)
Add a transform to the buffer
Sourcepub fn get_latest_transform(&self) -> Option<StampedTransform<T>>
pub fn get_latest_transform(&self) -> Option<StampedTransform<T>>
Get the latest transform in the buffer
Sourcepub fn get_time_range(&self) -> Option<CuTimeRange>
pub fn get_time_range(&self) -> Option<CuTimeRange>
Get the time range of transforms in this buffer
Sourcepub fn get_transforms_in_range(
&self,
start_time: CuTime,
end_time: CuTime,
) -> Vec<StampedTransform<T>>
pub fn get_transforms_in_range( &self, start_time: CuTime, end_time: CuTime, ) -> Vec<StampedTransform<T>>
Get transforms within a specific time range
Sourcepub fn get_closest_transform(&self, time: CuTime) -> Option<StampedTransform<T>>
pub fn get_closest_transform(&self, time: CuTime) -> Option<StampedTransform<T>>
Get the transform closest to the specified time
Sourcepub fn get_transforms_around(
&self,
time: CuTime,
) -> Option<(StampedTransform<T>, StampedTransform<T>)>
pub fn get_transforms_around( &self, time: CuTime, ) -> Option<(StampedTransform<T>, StampedTransform<T>)>
Get two transforms closest to the specified time, useful for velocity computation
Trait Implementations§
Source§impl<T: Clone + Copy + Debug + Default + 'static, const N: usize> Clone for ConstTransformBufferSync<T, N>
impl<T: Clone + Copy + Debug + Default + 'static, const N: usize> Clone for ConstTransformBufferSync<T, N>
Source§fn clone(&self) -> ConstTransformBufferSync<T, N>
fn clone(&self) -> ConstTransformBufferSync<T, N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<T, const N: usize> Freeze for ConstTransformBufferSync<T, N>
impl<T, const N: usize> RefUnwindSafe for ConstTransformBufferSync<T, N>
impl<T, const N: usize> Send for ConstTransformBufferSync<T, N>
impl<T, const N: usize> Sync for ConstTransformBufferSync<T, N>
impl<T, const N: usize> Unpin for ConstTransformBufferSync<T, N>
impl<T, const N: usize> UnwindSafe for ConstTransformBufferSync<T, 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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