DUNE: Uniform Navigational Environment  2022.04.0
DUNE::Power::Model Class Reference

Detailed Description

Utility class to compute offline power conversions and hold model parameters.

Consider ONLY positive speed.

Public Member Functions

 Model (Parsers::Config *cfg)
 
void validate (void) const
 
float computeMotionEnergy (float rpm, float duration) const
 
float computePayloadEnergy (const std::string &label, float duration) const
 
float computeHotelEnergy (float duration) const
 
float computeIMUEnergy (float duration) const
 
float getBatteryCapacity (void) const
 
float getPowerConsumptionHotel (void) const
 
float getPowerConsumptionFull (void) const
 

Constructor & Destructor Documentation

◆ Model()

DUNE::Power::Model::Model ( Parsers::Config cfg)

Constructor.

Parameters
[in]cfgreference to Config parser

References DUNE::Parsers::Config::get().

Member Function Documentation

◆ computeHotelEnergy()

float DUNE::Power::Model::computeHotelEnergy ( float  duration) const

Compute energy consumed by minimal resources.

Parameters
[in]durationamount of time in seconds
Returns
energy consumed in Wh

◆ computeIMUEnergy()

float DUNE::Power::Model::computeIMUEnergy ( float  duration) const

Compute energy consumed by IMU.

Parameters
[in]durationamount of time in seconds
Returns
energy consumed in Wh

References DUNE::Parsers::Config::get(), and DUNE::Utils::String::str().

◆ computeMotionEnergy()

float DUNE::Power::Model::computeMotionEnergy ( float  rpm,
float  duration 
) const

Compute energy consumed by motor for some RPM value.

Parameters
[in]rpmvalue of rpms to convert from
[in]durationamount of time rotating at rpm
Returns
energy consumed in Wh

References DUNE::Math::piecewiseLI().

◆ computePayloadEnergy()

float DUNE::Power::Model::computePayloadEnergy ( const std::string &  label,
float  duration 
) const

Compute energy consumed by a payload entity.

Parameters
[in]labelname of the payload
[in]durationamount of time active
Returns
energy consumed in Wh

◆ getBatteryCapacity()

float DUNE::Power::Model::getBatteryCapacity ( void  ) const
inline

Get the battery capacity.

Returns
battery energy capacity in Wh

◆ getPowerConsumptionFull()

float DUNE::Power::Model::getPowerConsumptionFull ( void  ) const
inline

◆ getPowerConsumptionHotel()

float DUNE::Power::Model::getPowerConsumptionHotel ( void  ) const
inline

◆ validate()

void DUNE::Power::Model::validate ( void  ) const

Validate the model.

Collaboration diagram for DUNE::Power::Model:
Collaboration graph