DUNE: Uniform Navigational Environment  2016.05.0
Monitors::FuelLevel::BatteryData Class Reference

Detailed Description

Battery data for Fuel Level.

Public Types

enum  BatteryMeasures { BM_VOLTAGE, BM_CURRENT, BM_TEMPERATURE, BM_TOTAL }
 

Public Member Functions

 BatteryData (const unsigned window_size[BM_TOTAL])
 
 ~BatteryData (void)
 
void setEntities (unsigned eids[])
 
bool update (BatteryMeasures bm, uint8_t entity, float value)
 
bool update (const IMC::Voltage *msg)
 
bool update (const IMC::Current *msg)
 
bool update (const IMC::Temperature *msg)
 
float getEnergyDrop (float timestep) const
 
float getVoltage (void) const
 
float getCurrent (void) const
 
float getTemperature (void) const
 
bool gotMeasurements (void) const
 

Member Enumeration Documentation

Enumerator
BM_VOLTAGE 

Voltage measures.

BM_CURRENT 

Current measures.

BM_TEMPERATURE 

Temperature measures.

BM_TOTAL 

Number of measures.

Constructor & Destructor Documentation

Monitors::FuelLevel::BatteryData::BatteryData ( const unsigned  window_size[BM_TOTAL])
inline

Constructor.

Parameters
[in]window_sizemoving averages window sizes

References BM_TOTAL.

Monitors::FuelLevel::BatteryData::~BatteryData ( void  )
inline

Destructor.

References BM_TOTAL.

Member Function Documentation

float Monitors::FuelLevel::BatteryData::getCurrent ( void  ) const
inline

Get current value.

Returns
current estimate

References BM_CURRENT, and DUNE::Math::MovingAverage< T >::mean().

Referenced by Monitors::FuelLevel::FuelFilter::update().

float Monitors::FuelLevel::BatteryData::getEnergyDrop ( float  timestep) const
inline

Compute energy drop.

Parameters
[in]timestepelapsed time to use in computation
Returns
computed energy drop

References BM_CURRENT, BM_VOLTAGE, and DUNE::Math::MovingAverage< T >::mean().

Referenced by Monitors::FuelLevel::FuelFilter::onVoltage().

float Monitors::FuelLevel::BatteryData::getTemperature ( void  ) const
inline

Get temperature value.

Returns
temperature estimate

References BM_TEMPERATURE, and DUNE::Math::MovingAverage< T >::mean().

Referenced by Monitors::FuelLevel::FuelFilter::update().

float Monitors::FuelLevel::BatteryData::getVoltage ( void  ) const
inline

Get voltage value.

Returns
voltage estimate

References BM_VOLTAGE, and DUNE::Math::MovingAverage< T >::mean().

bool Monitors::FuelLevel::BatteryData::gotMeasurements ( void  ) const
inline

Check if we have measurements.

Returns
false if some measurement has not been received yet

References BM_CURRENT, BM_TEMPERATURE, and BM_VOLTAGE.

Referenced by Monitors::FuelLevel::FuelFilter::update().

void Monitors::FuelLevel::BatteryData::setEntities ( unsigned  eids[])
inline

Set message entities.

Parameters
[in]eidsarray of entity ids

Referenced by Monitors::FuelLevel::FuelFilter::FuelFilter().

bool Monitors::FuelLevel::BatteryData::update ( BatteryMeasures  bm,
uint8_t  entity,
float  value 
)
inline

Update a measurement.

Parameters
[in]bmbattery measure type
[in]entityentity id to set
[in]valuemeasure value to update with
Returns
true if the value has been updated

References DUNE::Math::MovingAverage< T >::update().

Referenced by Monitors::FuelLevel::FuelFilter::onCurrent(), Monitors::FuelLevel::FuelFilter::onTemperature(), Monitors::FuelLevel::FuelFilter::onVoltage(), and update().

bool Monitors::FuelLevel::BatteryData::update ( const IMC::Voltage *  msg)
inline

Update Voltage.

Parameters
[in]msgvoltage message pointer
Returns
true if value was updated

References BM_VOLTAGE, and update().

bool Monitors::FuelLevel::BatteryData::update ( const IMC::Current *  msg)
inline

Update Current.

Parameters
[in]msgcurrent message pointer
Returns
true if value was updated

References BM_CURRENT, and update().

bool Monitors::FuelLevel::BatteryData::update ( const IMC::Temperature *  msg)
inline

Update Temperature.

Parameters
[in]msgtemperature message pointer
Returns
true if value was updated

References BM_TEMPERATURE, and update().

Collaboration diagram for Monitors::FuelLevel::BatteryData:
Collaboration graph