DUNE: Uniform Navigational Environment  2016.05.0
Plan::Engine::FuelPrediction Class Reference

Detailed Description

Plan Specification parser.

Public Member Functions

 FuelPrediction (const Plans::TimeProfile *profiles, const ComponentActiveTime *cat, const Power::Model *power_model, const Plans::SpeedModel *speed_model, bool imu_enabled, float total_duration)
 
 ~FuelPrediction (void)
 
void onFuelLevel (const IMC::FuelLevel *msg)
 
bool isFuelValid (void) const
 
float getPredictionError (void) const
 
float getTotal (bool relative=false) const
 
float getHotel (bool relative=false) const
 
float getPayload (bool relative=false) const
 
float getMotion (bool relative=false) const
 
float getIMU (bool relative=false) const
 

Constructor & Destructor Documentation

Plan::Engine::FuelPrediction::FuelPrediction ( const Plans::TimeProfile *  profiles,
const ComponentActiveTime cat,
const Power::Model *  power_model,
const Plans::SpeedModel *  speed_model,
bool  imu_enabled,
float  total_duration 
)
inline

Constructor.

References Plan::Engine::FP_IMU.

Plan::Engine::FuelPrediction::~FuelPrediction ( void  )
inline

Destructor.

Member Function Documentation

float Plan::Engine::FuelPrediction::getHotel ( bool  relative = false) const
inline

Get the hotel estimated fuel consumption.

Parameters
[in]relativeoutput result in percentage of battery
Returns
estimated fuel consumed in Wh

References Plan::Engine::FP_HOTEL.

Referenced by Plan::Engine::PreStatistics::fill().

float Plan::Engine::FuelPrediction::getIMU ( bool  relative = false) const
inline

Get the estimated fuel consumption by the IMU.

Parameters
[in]relativeoutput result in percentage of battery
Returns
estimated fuel consumed in Wh

References Plan::Engine::FP_IMU.

Referenced by Plan::Engine::PreStatistics::fill().

float Plan::Engine::FuelPrediction::getMotion ( bool  relative = false) const
inline

Get the motion estimated fuel consumption.

Parameters
[in]relativeoutput result in percentage of battery
Returns
estimated fuel consumed in Wh

References Plan::Engine::FP_MOTION.

Referenced by Plan::Engine::PreStatistics::fill().

float Plan::Engine::FuelPrediction::getPayload ( bool  relative = false) const
inline

Get the payload estimated fuel consumption.

Parameters
[in]relativeoutput result in percentage of battery
Returns
estimated fuel consumed in Wh

References Plan::Engine::FP_PAYLOAD.

Referenced by Plan::Engine::PreStatistics::fill().

float Plan::Engine::FuelPrediction::getPredictionError ( void  ) const
inline

Get the prediction error Check if the fuel values are valid first!

Returns
error in prediction in percentage

References getTotal().

Referenced by Plan::Engine::RunTimeStatistics::fill().

float Plan::Engine::FuelPrediction::getTotal ( bool  relative = false) const
inline

Get the total estimated fuel consumption.

Parameters
[in]relativeoutput result in percentage of battery
Returns
estimated fuel consumed in Wh

References Plan::Engine::FP_TOTAL.

Referenced by Plan::Engine::PreStatistics::fill(), and getPredictionError().

bool Plan::Engine::FuelPrediction::isFuelValid ( void  ) const
inline

Check if prediction error can be computed.

Returns
true if prediction error is valid, false otherwise

Referenced by Plan::Engine::RunTimeStatistics::fill().

void Plan::Engine::FuelPrediction::onFuelLevel ( const IMC::FuelLevel *  msg)
inline

Use fuel level messages to compute error in prediction.

Parameters
[in]msgFuelLevel message

Referenced by Plan::Engine::Plan::onFuelLevel().

Collaboration diagram for Plan::Engine::FuelPrediction:
Collaboration graph