pub struct SpatialAnchor {
pub anchor_id: String,
pub parent_frame: String,
pub geodetic_anchor: [f64; 3],
pub enu_offset: [f32; 3],
pub orientation_quat: [f32; 4],
pub confidence_radius_mm: f32,
pub vps_mesh_signature: Vec<u8>,
}Expand description
A persistent spatial anchor — world lock (OCS §5.2).
Fields§
§anchor_id: String§parent_frame: String§geodetic_anchor: [f64; 3]§enu_offset: [f32; 3]§orientation_quat: [f32; 4]§confidence_radius_mm: f32§vps_mesh_signature: Vec<u8>Implementations§
Source§impl SpatialAnchor
impl SpatialAnchor
Sourcepub fn new(anchor_id: &str, geodetic: [f64; 3]) -> Self
pub fn new(anchor_id: &str, geodetic: [f64; 3]) -> Self
Create a new spatial anchor at a geodetic position.
Sourcepub fn with_enu_offset(self, east: f32, north: f32, up: f32) -> Self
pub fn with_enu_offset(self, east: f32, north: f32, up: f32) -> Self
Set ENU offset from the geodetic anchor.
Sourcepub fn with_orientation(self, w: f32, x: f32, y: f32, z: f32) -> Self
pub fn with_orientation(self, w: f32, x: f32, y: f32, z: f32) -> Self
Set orientation quaternion [w, x, y, z].
Sourcepub fn with_confidence(self, radius_mm: f32) -> Self
pub fn with_confidence(self, radius_mm: f32) -> Self
Set confidence radius in mm.
Sourcepub fn is_submillimeter(&self) -> bool
pub fn is_submillimeter(&self) -> bool
Check if this anchor is sub-millimeter precision (OCS-T05).
Sourcepub fn is_quaternion_valid(&self) -> bool
pub fn is_quaternion_valid(&self) -> bool
Verify the quaternion is normalized.
Trait Implementations§
Source§impl Clone for SpatialAnchor
impl Clone for SpatialAnchor
Source§impl Debug for SpatialAnchor
impl Debug for SpatialAnchor
Source§impl PartialEq for SpatialAnchor
impl PartialEq for SpatialAnchor
impl StructuralPartialEq for SpatialAnchor
Auto Trait Implementations§
impl Freeze for SpatialAnchor
impl RefUnwindSafe for SpatialAnchor
impl Send for SpatialAnchor
impl Sync for SpatialAnchor
impl Unpin for SpatialAnchor
impl UnsafeUnpin for SpatialAnchor
impl UnwindSafe for SpatialAnchor
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