pub struct MavSysStatusSensor(/* private fields */);
common
only.Expand description
These encode the sensors whose status is sent as part of the SYS_STATUS message.
Implementations§
Source§impl MavSysStatusSensor
impl MavSysStatusSensor
Sourcepub const MAV_SYS_STATUS_SENSOR_3D_GYRO: Self
pub const MAV_SYS_STATUS_SENSOR_3D_GYRO: Self
0x01 3D gyro
Sourcepub const MAV_SYS_STATUS_SENSOR_3D_ACCEL: Self
pub const MAV_SYS_STATUS_SENSOR_3D_ACCEL: Self
0x02 3D accelerometer
Sourcepub const MAV_SYS_STATUS_SENSOR_3D_MAG: Self
pub const MAV_SYS_STATUS_SENSOR_3D_MAG: Self
0x04 3D magnetometer
Sourcepub const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE: Self
pub const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE: Self
0x08 absolute pressure
Sourcepub const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE: Self
pub const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE: Self
0x10 differential pressure
Sourcepub const MAV_SYS_STATUS_SENSOR_GPS: Self
pub const MAV_SYS_STATUS_SENSOR_GPS: Self
0x20 GPS
Sourcepub const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW: Self
pub const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW: Self
0x40 optical flow
Sourcepub const MAV_SYS_STATUS_SENSOR_VISION_POSITION: Self
pub const MAV_SYS_STATUS_SENSOR_VISION_POSITION: Self
0x80 computer vision position
Sourcepub const MAV_SYS_STATUS_SENSOR_LASER_POSITION: Self
pub const MAV_SYS_STATUS_SENSOR_LASER_POSITION: Self
0x100 laser based position
Sourcepub const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH: Self
pub const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH: Self
0x200 external ground truth (Vicon or Leica)
Sourcepub const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL: Self
pub const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL: Self
0x400 3D angular rate control
Sourcepub const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION: Self
pub const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION: Self
0x800 attitude stabilization
Sourcepub const MAV_SYS_STATUS_SENSOR_YAW_POSITION: Self
pub const MAV_SYS_STATUS_SENSOR_YAW_POSITION: Self
0x1000 yaw position
Sourcepub const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL: Self
pub const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL: Self
0x2000 z/altitude control
Sourcepub const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL: Self
pub const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL: Self
0x4000 x/y position control
Sourcepub const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS: Self
pub const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS: Self
0x8000 motor outputs / control
Sourcepub const MAV_SYS_STATUS_SENSOR_RC_RECEIVER: Self
pub const MAV_SYS_STATUS_SENSOR_RC_RECEIVER: Self
0x10000 RC receiver
Sourcepub const MAV_SYS_STATUS_SENSOR_3D_GYRO2: Self
pub const MAV_SYS_STATUS_SENSOR_3D_GYRO2: Self
0x20000 2nd 3D gyro
Sourcepub const MAV_SYS_STATUS_SENSOR_3D_ACCEL2: Self
pub const MAV_SYS_STATUS_SENSOR_3D_ACCEL2: Self
0x40000 2nd 3D accelerometer
Sourcepub const MAV_SYS_STATUS_SENSOR_3D_MAG2: Self
pub const MAV_SYS_STATUS_SENSOR_3D_MAG2: Self
0x80000 2nd 3D magnetometer
Sourcepub const MAV_SYS_STATUS_GEOFENCE: Self
pub const MAV_SYS_STATUS_GEOFENCE: Self
0x100000 geofence
Sourcepub const MAV_SYS_STATUS_AHRS: Self
pub const MAV_SYS_STATUS_AHRS: Self
0x200000 AHRS subsystem health
Sourcepub const MAV_SYS_STATUS_TERRAIN: Self
pub const MAV_SYS_STATUS_TERRAIN: Self
0x400000 Terrain subsystem health
Sourcepub const MAV_SYS_STATUS_REVERSE_MOTOR: Self
pub const MAV_SYS_STATUS_REVERSE_MOTOR: Self
0x800000 Motors are reversed
Sourcepub const MAV_SYS_STATUS_LOGGING: Self
pub const MAV_SYS_STATUS_LOGGING: Self
0x1000000 Logging
Sourcepub const MAV_SYS_STATUS_SENSOR_BATTERY: Self
pub const MAV_SYS_STATUS_SENSOR_BATTERY: Self
0x2000000 Battery
Sourcepub const MAV_SYS_STATUS_SENSOR_PROXIMITY: Self
pub const MAV_SYS_STATUS_SENSOR_PROXIMITY: Self
0x4000000 Proximity
Sourcepub const MAV_SYS_STATUS_SENSOR_SATCOM: Self
pub const MAV_SYS_STATUS_SENSOR_SATCOM: Self
0x8000000 Satellite Communication
Sourcepub const MAV_SYS_STATUS_PREARM_CHECK: Self
pub const MAV_SYS_STATUS_PREARM_CHECK: Self
0x10000000 pre-arm check status. Always healthy when armed
Sourcepub const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE: Self
pub const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE: Self
0x20000000 Avoidance/collision prevention
Sourcepub const MAV_SYS_STATUS_SENSOR_PROPULSION: Self
pub const MAV_SYS_STATUS_SENSOR_PROPULSION: Self
0x40000000 propulsion (actuator, esc, motor or propellor)
Sourcepub const MAV_SYS_STATUS_EXTENSION_USED: Self
pub const MAV_SYS_STATUS_EXTENSION_USED: Self
0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)
Source§impl MavSysStatusSensor
impl MavSysStatusSensor
Sourcepub const fn bits(&self) -> u32
pub const fn bits(&self) -> u32
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub const fn from_bits(bits: u32) -> Option<Self>
pub const fn from_bits(bits: u32) -> Option<Self>
Convert from a bits value.
This method will return None
if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u32) -> Self
pub const fn from_bits_truncate(bits: u32) -> Self
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u32) -> Self
pub const fn from_bits_retain(bits: u32) -> Self
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Get a flags value with the bits of a flag with the given name set.
This method will return None
if name
is empty or doesn’t
correspond to any named flag.
Sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn remove(&mut self, other: Self)
pub fn remove(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
remove
won’t truncate other
, but the !
operator will.
Sourcepub fn toggle(&mut self, other: Self)
pub fn toggle(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
The bitwise and (&
) of the bits in two flags values.
Sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
The bitwise or (|
) of the bits in two flags values.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
Sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
The bitwise negation (!
) of the bits in a flags value, truncating the result.
Source§impl MavSysStatusSensor
impl MavSysStatusSensor
Sourcepub const fn iter(&self) -> Iter<MavSysStatusSensor>
pub const fn iter(&self) -> Iter<MavSysStatusSensor>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
Sourcepub const fn iter_names(&self) -> IterNames<MavSysStatusSensor>
pub const fn iter_names(&self) -> IterNames<MavSysStatusSensor>
Yield a set of contained named flags values.
This method is like iter
, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Trait Implementations§
Source§impl Binary for MavSysStatusSensor
impl Binary for MavSysStatusSensor
Source§impl BitAnd for MavSysStatusSensor
impl BitAnd for MavSysStatusSensor
Source§impl BitAndAssign for MavSysStatusSensor
impl BitAndAssign for MavSysStatusSensor
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
The bitwise and (&
) of the bits in two flags values.
Source§impl BitOr for MavSysStatusSensor
impl BitOr for MavSysStatusSensor
Source§fn bitor(self, other: MavSysStatusSensor) -> Self
fn bitor(self, other: MavSysStatusSensor) -> Self
The bitwise or (|
) of the bits in two flags values.
Source§type Output = MavSysStatusSensor
type Output = MavSysStatusSensor
|
operator.Source§impl BitOrAssign for MavSysStatusSensor
impl BitOrAssign for MavSysStatusSensor
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
The bitwise or (|
) of the bits in two flags values.
Source§impl BitXor for MavSysStatusSensor
impl BitXor for MavSysStatusSensor
Source§impl BitXorAssign for MavSysStatusSensor
impl BitXorAssign for MavSysStatusSensor
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
Source§impl Clone for MavSysStatusSensor
impl Clone for MavSysStatusSensor
Source§fn clone(&self) -> MavSysStatusSensor
fn clone(&self) -> MavSysStatusSensor
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MavSysStatusSensor
impl Debug for MavSysStatusSensor
Source§impl Default for MavSysStatusSensor
impl Default for MavSysStatusSensor
Source§impl<'de> Deserialize<'de> for MavSysStatusSensor
impl<'de> Deserialize<'de> for MavSysStatusSensor
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>,
Source§impl Extend<MavSysStatusSensor> for MavSysStatusSensor
impl Extend<MavSysStatusSensor> for MavSysStatusSensor
Source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
The bitwise or (|
) of the bits in each flags value.
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl Flags for MavSysStatusSensor
impl Flags for MavSysStatusSensor
Source§const FLAGS: &'static [Flag<MavSysStatusSensor>]
const FLAGS: &'static [Flag<MavSysStatusSensor>]
Source§fn from_bits_retain(bits: u32) -> MavSysStatusSensor
fn from_bits_retain(bits: u32) -> MavSysStatusSensor
Source§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true
if any unknown bits are set.Source§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
Source§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
Source§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
Source§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|
) of the bits in two flags values.Source§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!
). Read moreSource§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^
) of the bits in two flags values.Source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&
) of the bits in two flags values.Source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!
). Read moreSource§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^
) of the bits in two flags values.Source§fn complement(self) -> Self
fn complement(self) -> Self
!
) of the bits in a flags value, truncating the result.Source§impl FromIterator<MavSysStatusSensor> for MavSysStatusSensor
impl FromIterator<MavSysStatusSensor> for MavSysStatusSensor
Source§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
The bitwise or (|
) of the bits in each flags value.
Source§impl IntoIterator for MavSysStatusSensor
impl IntoIterator for MavSysStatusSensor
Source§impl LowerHex for MavSysStatusSensor
impl LowerHex for MavSysStatusSensor
Source§impl Not for MavSysStatusSensor
impl Not for MavSysStatusSensor
Source§impl Octal for MavSysStatusSensor
impl Octal for MavSysStatusSensor
Source§impl PartialEq for MavSysStatusSensor
impl PartialEq for MavSysStatusSensor
Source§impl PublicFlags for MavSysStatusSensor
impl PublicFlags for MavSysStatusSensor
Source§impl Serialize for MavSysStatusSensor
impl Serialize for MavSysStatusSensor
Source§impl Sub for MavSysStatusSensor
impl Sub for MavSysStatusSensor
Source§fn sub(self, other: Self) -> Self
fn sub(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
Source§type Output = MavSysStatusSensor
type Output = MavSysStatusSensor
-
operator.Source§impl SubAssign for MavSysStatusSensor
impl SubAssign for MavSysStatusSensor
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.