Struct canadensis_data_types::reg::udral::physics::electricity::source_0_1::Source
source · #[repr(C, packed)]pub struct Source {
pub power: Power,
pub energy: Scalar,
pub full_energy: Scalar,
}
Expand description
reg.udral.physics.electricity.Source.0.1
Fixed size 16 bytes
A generic source or sink of electric power (battery, turbogenerator, braking resistor, etc.). Low-pass filtering should be applied to avoid aliasing effects (as is the case everywhere else).
Fields§
§power: Power
Total instant load power. Positive current flows into the source (power sinking). Negative current flows from the source to the power supply network (power sourcing).
reg.udral.physics.electricity.Power.0.1
Always aligned, size 64 bits
energy: Scalar
A pessimistic estimate of the amount of energy that can be reclaimed from the source in its current state. This may be dependent on the state of charge/health (for batteries), temperature, load profile, humidity, etc. Negative values may be reported to indicate overdischarge or depletion of the reserve energy.
This value approximates (full_energy + int(load_power dt)) plus the environmental influences on the source.
Having the instant power, the time to depletion is estimated as (energy/-power). When charging (for batteries), the remaining time to full charge can be found similarly as ((full_energy-energy)/power).
For the sake of illustration, if this type was used to represent the state of a braking resistor, then this value would be negative indicating the amount of dissipated energy.
uavcan.si.unit.energy.Scalar.1.0
Always aligned, size 32 bits
full_energy: Scalar
A pessimistic estimate of the amount of energy that can be reclaimed from a fresh source (fully fueled generator or a fully charged battery) under the current conditions (SoH, temperature, load profile, etc).
uavcan.si.unit.energy.Scalar.1.0
Always aligned, size 32 bits
Trait Implementations§
source§impl AsBytes for Sourcewhere
Power: AsBytes,
Scalar: AsBytes,
impl AsBytes for Sourcewhere Power: AsBytes, Scalar: AsBytes,
source§fn as_bytes_mut(&mut self) -> &mut [u8]where
Self: FromBytes,
fn as_bytes_mut(&mut self) -> &mut [u8]where Self: FromBytes,
source§fn write_to_prefix<B>(&self, bytes: B) -> Option<()>where
B: ByteSliceMut,
fn write_to_prefix<B>(&self, bytes: B) -> Option<()>where B: ByteSliceMut,
source§fn write_to_suffix<B>(&self, bytes: B) -> Option<()>where
B: ByteSliceMut,
fn write_to_suffix<B>(&self, bytes: B) -> Option<()>where B: ByteSliceMut,
source§impl Deserialize for Source
impl Deserialize for Source
source§fn deserialize(cursor: &mut ReadCursor<'_>) -> Result<Self, DeserializeError>where
Self: Sized,
fn deserialize(cursor: &mut ReadCursor<'_>) -> Result<Self, DeserializeError>where Self: Sized,
source§fn deserialize_zero_copy(cursor: &mut ReadCursor<'_>) -> Selfwhere
Self: Sized + AsBytes + FromBytes,
fn deserialize_zero_copy(cursor: &mut ReadCursor<'_>) -> Selfwhere Self: Sized + AsBytes + FromBytes,
source§fn deserialize_from_bytes(bytes: &[u8]) -> Result<Self, DeserializeError>where
Self: Sized,
fn deserialize_from_bytes(bytes: &[u8]) -> Result<Self, DeserializeError>where Self: Sized,
deserialize
source§impl FromBytes for Sourcewhere
Power: FromBytes,
Scalar: FromBytes,
impl FromBytes for Sourcewhere Power: FromBytes, Scalar: FromBytes,
source§fn new_zeroed() -> Selfwhere
Self: Sized,
fn new_zeroed() -> Selfwhere Self: Sized,
Self
from zeroed bytes.source§impl Serialize for Source
impl Serialize for Source
source§fn size_bits(&self) -> usize
fn size_bits(&self) -> usize
source§fn serialize(&self, cursor: &mut WriteCursor<'_>)
fn serialize(&self, cursor: &mut WriteCursor<'_>)
source§fn serialize_to_bytes(&self, bytes: &mut [u8])
fn serialize_to_bytes(&self, bytes: &mut [u8])
serialize