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
sourceimpl 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.
Trait Implementations
sourceimpl ConcreteMessage for MsgImuAux
impl ConcreteMessage for MsgImuAux
sourceconst MESSAGE_TYPE: u16 = 2_305u16
const MESSAGE_TYPE: u16 = 2_305u16
The message type.
sourceconst MESSAGE_NAME: &'static str = "MSG_IMU_AUX"
const MESSAGE_NAME: &'static str = "MSG_IMU_AUX"
The message name.
sourceimpl SbpMessage for MsgImuAux
impl SbpMessage for MsgImuAux
sourcefn message_name(&self) -> &'static str
fn message_name(&self) -> &'static str
Get the message name.
sourcefn message_type(&self) -> u16
fn message_type(&self) -> u16
Get the message type.
sourcefn set_sender_id(&mut self, new_id: u16)
fn set_sender_id(&mut self, new_id: u16)
Set the sender id.
sourcefn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Number of bytes this message will take on the wire.
Auto Trait Implementations
impl RefUnwindSafe for MsgImuAux
impl Send for MsgImuAux
impl Sync for MsgImuAux
impl Unpin for MsgImuAux
impl UnwindSafe for MsgImuAux
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more