pub struct TransformBuffer<T: Copy + Debug + Default + 'static> { /* private fields */ }
Expand description
Thread-safe wrapper around a transform buffer with concurrent access
Implementations§
Source§impl<T: Copy + Debug + Default + 'static> TransformBuffer<T>
impl<T: Copy + Debug + Default + 'static> TransformBuffer<T>
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> 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§
Auto Trait Implementations§
impl<T> Freeze for TransformBuffer<T>
impl<T> RefUnwindSafe for TransformBuffer<T>
impl<T> Send for TransformBuffer<T>
impl<T> Sync for TransformBuffer<T>
impl<T> Unpin for TransformBuffer<T>
impl<T> UnwindSafe for TransformBuffer<T>
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