pub struct BATTERY_STATUS_V2_DATA {
pub voltage: f32,
pub current: f32,
pub capacity_consumed: f32,
pub capacity_remaining: f32,
pub status_flags: MavBatteryStatusFlags,
pub temperature: i16,
pub id: u8,
pub percent_remaining: u8,
}dialect-development only.Expand description
Battery dynamic information. This should be streamed (nominally at 1Hz). Static/invariant battery information is sent in BATTERY_INFO. Note that smart batteries should set the MAV_BATTERY_STATUS_FLAGS_CAPACITY_RELATIVE_TO_FULL bit to indicate that supplied capacity values are relative to a battery that is known to be full. Power monitors would not set this bit, indicating that capacity_consumed is relative to drone power-on, and that other values are estimated based on the assumption that the battery was full on power-on.
ID: 369
Fields§
§voltage: f32Battery voltage (total). NaN: field not provided.
current: f32Battery current (through all cells/loads). Positive value when discharging and negative if charging. NaN: field not provided.
capacity_consumed: f32Consumed charge. NaN: field not provided. This is either the consumption since power-on or since the battery was full, depending on the value of MAV_BATTERY_STATUS_FLAGS_CAPACITY_RELATIVE_TO_FULL.
capacity_remaining: f32Remaining charge (until empty). NaN: field not provided. Note: If MAV_BATTERY_STATUS_FLAGS_CAPACITY_RELATIVE_TO_FULL is unset, this value is based on the assumption the battery was full when the system was powered.
status_flags: MavBatteryStatusFlagsFault, health, readiness, and other status indications.
temperature: i16Temperature of the whole battery pack (not internal electronics). INT16_MAX field not provided.
id: u8Battery ID
percent_remaining: u8Remaining battery energy. Values: [0-100], UINT8_MAX: field not provided.
Implementations§
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for BATTERY_STATUS_V2_DATA
impl<'arbitrary> Arbitrary<'arbitrary> for BATTERY_STATUS_V2_DATA
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§impl Clone for BATTERY_STATUS_V2_DATA
impl Clone for BATTERY_STATUS_V2_DATA
Source§fn clone(&self) -> BATTERY_STATUS_V2_DATA
fn clone(&self) -> BATTERY_STATUS_V2_DATA
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BATTERY_STATUS_V2_DATA
impl Debug for BATTERY_STATUS_V2_DATA
Source§impl Default for BATTERY_STATUS_V2_DATA
impl Default for BATTERY_STATUS_V2_DATA
Source§impl<'de> Deserialize<'de> for BATTERY_STATUS_V2_DATA
impl<'de> Deserialize<'de> for BATTERY_STATUS_V2_DATA
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 MessageData for BATTERY_STATUS_V2_DATA
impl MessageData for BATTERY_STATUS_V2_DATA
Source§impl PartialEq for BATTERY_STATUS_V2_DATA
impl PartialEq for BATTERY_STATUS_V2_DATA
Source§impl Serialize for BATTERY_STATUS_V2_DATA
impl Serialize for BATTERY_STATUS_V2_DATA
Source§impl TS for BATTERY_STATUS_V2_DATA
impl TS for BATTERY_STATUS_V2_DATA
Source§type WithoutGenerics = BATTERY_STATUS_V2_DATA
type WithoutGenerics = BATTERY_STATUS_V2_DATA
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or ().
The only requirement for these dummy types is that EXPORT_TO must be None. Read moreSource§type OptionInnerType = BATTERY_STATUS_V2_DATA
type OptionInnerType = BATTERY_STATUS_V2_DATA
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete() -> String
fn decl_concrete() -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl() -> String
fn decl() -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline() -> String
fn inline() -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened() -> String
fn inline_flattened() -> String
This function will panic if the type cannot be flattened.
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported.The returned path does not include the base directory from
TS_RS_EXPORT_DIR. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
§fn dependencies() -> Vec<Dependency>where
Self: 'static,
fn dependencies() -> Vec<Dependency>where
Self: 'static,
§fn export() -> Result<(), ExportError>where
Self: 'static,
fn export() -> Result<(), ExportError>where
Self: 'static,
TS::export_all]. Read more§fn export_all() -> Result<(), ExportError>where
Self: 'static,
fn export_all() -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use [
TS::export]. Read more§fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use [
TS::export]. Read more§fn export_to_string() -> Result<String, ExportError>where
Self: 'static,
fn export_to_string() -> Result<String, ExportError>where
Self: 'static,
§fn default_output_path() -> Option<PathBuf>
fn default_output_path() -> Option<PathBuf>
T should be exported. Read more