pub struct Target {
pub x: i16,
pub y: i16,
pub speed: i16,
pub distance_resolution: u16,
}Expand description
A single tracked target reported by the radar.
Fields§
§x: i16X coordinate in mm. Positive = right of sensor, negative = left.
y: i16Y coordinate in mm. Always positive (in front of sensor).
speed: i16Speed in cm/s. Positive = approaching, negative = receding.
distance_resolution: u16Distance gate resolution in mm.
Implementations§
Source§impl Target
impl Target
Sourcepub fn speed_ms(&self) -> f32
pub fn speed_ms(&self) -> f32
Radial speed in m/s. Positive = approaching, negative = receding.
Sourcepub fn from_bytes(data: &[u8; 8]) -> Self
pub fn from_bytes(data: &[u8; 8]) -> Self
Parse a target from 8 bytes of in-frame data.
Byte layout (little-endian): [0..2] x coordinate (signed, bit15: 1=positive, 0=negative) [2..4] y coordinate (signed, bit15: 1=positive, 0=negative) [4..6] speed (signed, bit15: 1=positive/approaching, 0=negative/receding) [6..8] distance resolution (unsigned)
Trait Implementations§
impl Copy for Target
impl Eq for Target
impl StructuralPartialEq for Target
Auto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnsafeUnpin for Target
impl UnwindSafe for Target
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