pub trait MotionSystem {
fn is_acceleration_supported(&self) -> bool;
fn acceleration(&self) -> &Signal1<Acceleration>;
fn acceleration_including_gravity(&self) -> &Signal1<Acceleration>;
fn is_attitude_supported(&self) -> bool;
fn attitude(&self) -> &Signal1<Attitude>;
}
Expand description
Functions related to the device’s motion sensors.
Required Methods
fn is_acceleration_supported(&self) -> bool
fn is_acceleration_supported(&self) -> bool
Whether device acceleration events are supported. If true, the acceleration and/or accelerationIncludingGravity signals will be emitted.
fn acceleration(&self) -> &Signal1<Acceleration>
fn acceleration(&self) -> &Signal1<Acceleration>
Periodically emits the device’s current linear acceleration, excluding the pull of gravity. This will only be emitted if the device has a gyroscope.
fn acceleration_including_gravity(&self) -> &Signal1<Acceleration>
fn acceleration_including_gravity(&self) -> &Signal1<Acceleration>
Periodically emits the devices’s current linear acceleration, including the pull of gravity.
fn is_attitude_supported(&self) -> bool
fn is_attitude_supported(&self) -> bool
Whether device orientation (attitude) events are supported.