pub struct MsgImuAux {
pub sender_id: Option<u16>,
pub imu_type: u8,
pub temp: i16,
pub imu_conf: u8,
}
Expand description
Auxiliary IMU data
Auxiliary data specific to a particular IMU. The imu_type
field will
always be consistent but the rest of the payload is device specific and
depends on the value of imu_type
.
Fields§
§sender_id: Option<u16>
The message sender_id
imu_type: u8
IMU type
temp: i16
Raw IMU temperature
imu_conf: u8
IMU configuration
Implementations§
source§impl MsgImuAux
impl MsgImuAux
sourcepub fn imu_type(&self) -> Result<ImuType, u8>
pub fn imu_type(&self) -> Result<ImuType, u8>
Gets the ImuType stored in the imu_type
bitfield.
Returns Ok
if the bitrange contains a known ImuType
variant.
Otherwise the value of the bitrange is returned as an Err(u8)
. This may be because of a malformed message,
or because new variants of ImuType
were added.
sourcepub fn set_imu_type(&mut self, imu_type: ImuType)
pub fn set_imu_type(&mut self, imu_type: ImuType)
Set the bitrange corresponding to the ImuType of the imu_type
bitfield.
sourcepub fn gyroscope_range(&self) -> Result<GyroscopeRange, u8>
pub fn gyroscope_range(&self) -> Result<GyroscopeRange, u8>
Gets the GyroscopeRange stored in the imu_conf
bitfield.
Returns Ok
if the bitrange contains a known GyroscopeRange
variant.
Otherwise the value of the bitrange is returned as an Err(u8)
. This may be because of a malformed message,
or because new variants of GyroscopeRange
were added.
sourcepub fn set_gyroscope_range(&mut self, gyroscope_range: GyroscopeRange)
pub fn set_gyroscope_range(&mut self, gyroscope_range: GyroscopeRange)
Set the bitrange corresponding to the GyroscopeRange of the imu_conf
bitfield.
sourcepub fn accelerometer_range(&self) -> Result<AccelerometerRange, u8>
pub fn accelerometer_range(&self) -> Result<AccelerometerRange, u8>
Gets the AccelerometerRange stored in the imu_conf
bitfield.
Returns Ok
if the bitrange contains a known AccelerometerRange
variant.
Otherwise the value of the bitrange is returned as an Err(u8)
. This may be because of a malformed message,
or because new variants of AccelerometerRange
were added.
sourcepub fn set_accelerometer_range(
&mut self,
accelerometer_range: AccelerometerRange
)
pub fn set_accelerometer_range( &mut self, accelerometer_range: AccelerometerRange )
Set the bitrange corresponding to the AccelerometerRange of the imu_conf
bitfield.