Struct robotics_signals::sensors::battery_state::BatteryState
source · [−]#[repr(C)]pub struct BatteryState {Show 16 fields
pub header: Header,
pub voltage: f32,
pub temperature: f32,
pub current: f32,
pub charge: f32,
pub capacity: f32,
pub design_capacity: f32,
pub percentage: f32,
pub status: PowerSupplyStatus,
pub health: PowerSupplyHealth,
pub technology: BatteryChemistry,
pub present: bool,
pub cell_voltage: Vec<f32>,
pub cell_temperature: Vec<f32>,
pub location: String,
pub serial_number: String,
}
Fields
header: Header
voltage: f32
Voltage in Volts (Mandatory)
temperature: f32
Temperature in Degrees Celsius (If unmeasured NaN)
current: f32
Negative when discharging (A) (If unmeasured NaN)
charge: f32
Current charge in Ah (If unmeasured NaN)
capacity: f32
Capacity in Ah (last full capacity) (If unmeasured NaN)
design_capacity: f32
Capacity in Ah (design capacity) (If unmeasured NaN)
percentage: f32
Charge percentage on 0 to 1 range (If unmeasured NaN)
status: PowerSupplyStatus
health: PowerSupplyHealth
technology: BatteryChemistry
present: bool
True if the battery is present
cell_voltage: Vec<f32>
An array of individual cell voltages for each cell in the pack
cell_temperature: Vec<f32>
An array of individual cell temperatures for each cell in the pack
If individual temperatures unknown but number of cells known set each to NaN
location: String
The location into which the battery is inserted. (slot number or plug)
serial_number: String
The best approximation of the battery serial number
Implementations
sourceimpl BatteryState
impl BatteryState
sourcepub fn create_topic_with_name(
participant: &DdsParticipant,
name: &str,
maybe_qos: Option<DdsQos>,
maybe_listener: Option<DdsListener>
) -> Result<DdsTopic<Self>, DDSError>
pub fn create_topic_with_name(
participant: &DdsParticipant,
name: &str,
maybe_qos: Option<DdsQos>,
maybe_listener: Option<DdsListener>
) -> Result<DdsTopic<Self>, DDSError>
Create a topic using of this Type specifying the topic name
Arguments
participant
- The participant handle onto which this topic should be createdname
- The name of the topicmaybe_qos
- A QoS structure for this topic. The Qos is optionalmaybe_listener
- A listener to use on this topic. The listener is optional
sourcepub fn create_topic(
participant: &DdsParticipant,
maybe_topic_prefix: Option<&str>,
maybe_qos: Option<DdsQos>,
maybe_listener: Option<DdsListener>
) -> Result<DdsTopic<Self>, DDSError>
pub fn create_topic(
participant: &DdsParticipant,
maybe_topic_prefix: Option<&str>,
maybe_qos: Option<DdsQos>,
maybe_listener: Option<DdsListener>
) -> Result<DdsTopic<Self>, DDSError>
Create a topic of this Type using the default topic name. The default topic name is provided by the Self::topic_name function.
Arguments
participant
- The participant handle onto which this topic should be createdmaybe_topic_prefix
- An additional prefix to be added to the topic name. This can be Nonemaybe_qos
- A QoS structure for this topic. The Qos is optionalmaybe_listener
- A listener to use on this topic. The listener is optional
sourcepub fn create_sample_buffer(len: usize) -> SampleBuffer<BatteryState>
pub fn create_sample_buffer(len: usize) -> SampleBuffer<BatteryState>
Create a sample buffer for storing an array of samples You can pass the sample buffer into a read to read multiple samples. Multiple samples are useful when you have one or more keys in your topic structure. Each value of the key will result in the storage of another sample.