Skip to main content

system

Macro system 

Source
macro_rules! system {
    ($(#[$attr:meta])* $vis:vis struct $name:ident using right-handed XYZ) => { ... };
    ($(#[$attr:meta])* $vis:vis struct $name:ident using NED) => { ... };
    ($(#[$attr:meta])* $vis:vis struct $name:ident using FRD) => { ... };
    ($(#[$attr:meta])* $vis:vis struct $name:ident using ENU) => { ... };
    (_clockwise_from_x_and_negative_z_bearing, $name:ident) => { ... };
    (_clockwise_from_y_and_positive_z_bearing, $name:ident) => { ... };
    {
        $(#[$attr:meta])*
        $vis:vis struct $name:ident
        as $convention:ident
    } => { ... };
}
Expand description

Defines a new coordinate system and its conventions.

Note that the coordinate system is a zero-sized type used only to mark things like Coordinate and Vector with what coordinate system they are in. A coordinate system does not know its relation to any other coordinate system (or global positions like WGS84).

At present, this macro allows you to define the following kinds of coordinate systems:

NedLike

system!(pub struct SensorNed using NED);

EnuLike

system!(pub struct SensorEnu using ENU);

FrdLike

system!(pub struct EmitterFrd using FRD);

RightHandedXyzLike

system!(pub struct PlaneEcef using right-handed XYZ);

You can include doc comments and attributes directly in the invocation of system! to add docs and derived traits to your type:

sguaba::system! {
    #[derive(Hash)]
    pub(crate) struct SensorNed using NED
}