pub struct Odometry {
pub timestamp: u64,
pub position: [f32; 3],
pub orientation: [f32; 4],
pub linear_velocity: [f32; 3],
pub angular_velocity: [f32; 3],
pub frame_id: Option<String>,
pub child_frame_id: Option<String>,
}Expand description
Odometry data (position and velocity)
Represents the robot’s estimated position and velocity
Fields§
§timestamp: u64Timestamp in microseconds since epoch
position: [f32; 3]Position (x, y, z) in meters
orientation: [f32; 4]Orientation as quaternion (x, y, z, w)
linear_velocity: [f32; 3]Linear velocity (x, y, z) in m/s
angular_velocity: [f32; 3]Angular velocity (x, y, z) in rad/s
frame_id: Option<String>Optional frame ID
child_frame_id: Option<String>Optional child frame ID
Implementations§
Source§impl Odometry
impl Odometry
Sourcepub fn position_2d(&self) -> (f32, f32)
pub fn position_2d(&self) -> (f32, f32)
Returns the 2D position (x, y)
Sourcepub fn velocity_2d(&self) -> (f32, f32)
pub fn velocity_2d(&self) -> (f32, f32)
Returns the 2D linear velocity (vx, vy)
Sourcepub fn distance_to(&self, other: &Odometry) -> f32
pub fn distance_to(&self, other: &Odometry) -> f32
Calculates distance to another position in meters
Sourcepub fn distance_2d_to(&self, other: &Odometry) -> f32
pub fn distance_2d_to(&self, other: &Odometry) -> f32
Calculates 2D distance to another position in meters
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Odometry
impl<'de> Deserialize<'de> for Odometry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Message for Odometry
Auto Trait Implementations§
impl Freeze for Odometry
impl RefUnwindSafe for Odometry
impl Send for Odometry
impl Sync for Odometry
impl Unpin for Odometry
impl UnwindSafe for Odometry
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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