DUNE: Uniform Navigational Environment
2019.02.1
|
Plan Specification parser.
Classes | |
struct | ParseError |
Public Member Functions | |
Plan (const IMC::PlanSpecification *spec, bool compute_progress, bool fpredict, float max_depth, Tasks::Task *task, uint16_t min_cal_time, Parsers::Config *cfg) | |
~Plan (void) | |
void | clear (void) |
void | parse (const std::set< uint16_t > *supported_maneuvers, const std::map< std::string, IMC::EntityInfo > &cinfo, IMC::PlanStatistics &ps, bool imu_enabled=false, const IMC::EstimatedState *state=NULL) |
void | planStarted (void) |
void | planStopped (void) |
void | calibrationStarted (void) |
void | maneuverStarted (const std::string &id) |
void | maneuverDone (void) |
uint16_t | getEstimatedCalibrationTime (void) const |
bool | isDone (void) const |
IMC::PlanManeuver * | loadStartManeuver (void) |
IMC::PlanManeuver * | loadNextManeuver (void) |
std::string | getCurrentId (void) const |
const std::string | getCalibrationInfo (void) const |
bool | isCalibrationDone (void) const |
bool | hasCalibrationFailed (void) const |
float | updateProgress (const IMC::ManeuverControlState *mcs) |
void | updateCalibration (const IMC::VehicleState *vs) |
bool | onEntityActivationState (const std::string &id, const IMC::EntityActivationState *msg) |
void | onFuelLevel (const IMC::FuelLevel *msg) |
float | getETA (void) const |
Plan::Engine::Plan::Plan | ( | const IMC::PlanSpecification * | spec, |
bool | compute_progress, | ||
bool | fpredict, | ||
float | max_depth, | ||
Tasks::Task * | task, | ||
uint16_t | min_cal_time, | ||
Parsers::Config * | cfg | ||
) |
Default constructor.
[in] | spec | pointer to PlanSpecification message |
[in] | compute_progress | true if progress should be computed |
[in] | fpredict | true if fuel prediction should be computed |
[in] | max_depth | maximum admissible depth |
[in] | task | pointer to task |
[in] | min_cal_time | minimum calibration time in s. |
[in] | cfg | pointer to config object |
References Plan::Engine::Calibration.
Plan::Engine::Plan::~Plan | ( | void | ) |
Destructor.
void Plan::Engine::Plan::calibrationStarted | ( | void | ) |
Signal that calibration has started.
References Plan::Engine::Calibration::setTime().
void Plan::Engine::Plan::clear | ( | void | ) |
Reset data.
References Plan::Engine::Calibration::clear(), and Plan::Engine::ComponentActiveTime::clear().
Referenced by parse().
|
inline |
Get calibration info string.
|
inline |
uint16_t Plan::Engine::Plan::getEstimatedCalibrationTime | ( | void | ) | const |
Get necessary calibration time.
float Plan::Engine::Plan::getETA | ( | void | ) | const |
Get current estimated time of arrival.
References Plan::Engine::ActionSchedule, Plan::Engine::ActionSchedule::calibTimeLeft(), Plan::Engine::PreStatistics::fill(), Plan::Engine::ActionSchedule::fillComponentActiveTime(), Plan::Engine::FuelPrediction, getCurrentId(), Plan::Engine::ActionSchedule::getEarliestSchedule(), Plan::Engine::Timeline::getPlanETA(), Plan::Engine::Calibration::getRemaining(), Plan::Engine::Calibration::inProgress(), Plan::Engine::Calibration::notStarted(), Plan::Engine::Timeline::setManeuverETA(), Plan::Engine::Timeline::setPlanETA(), Plan::Engine::Statistics::setProperties(), DUNE::Math::trimValue(), and Plan::Engine::ActionSchedule::waitingForDevice().
Referenced by updateProgress().
|
inline |
Has calibration failed.
|
inline |
Is calibration done.
bool Plan::Engine::Plan::isDone | ( | void | ) | const |
Check if plan has been completed.
IMC::PlanManeuver * Plan::Engine::Plan::loadNextManeuver | ( | void | ) |
Get next maneuver message.
IMC::PlanManeuver * Plan::Engine::Plan::loadStartManeuver | ( | void | ) |
Get start maneuver message.
void Plan::Engine::Plan::maneuverDone | ( | void | ) |
Signal that current maneuver is done.
References Plan::Engine::ActionSchedule::maneuverDone(), and Plan::Engine::RunTimeStatistics::maneuverStopped().
void Plan::Engine::Plan::maneuverStarted | ( | const std::string & | id | ) |
Signal that a maneuver has started.
[in] | id | name of the started maneuver |
References Plan::Engine::ActionSchedule::maneuverStarted(), and Plan::Engine::RunTimeStatistics::maneuverStarted().
bool Plan::Engine::Plan::onEntityActivationState | ( | const std::string & | id, |
const IMC::EntityActivationState * | msg | ||
) |
Pass EntityActivationState to scheduler.
[in] | id | entity label |
[in] | msg | pointer to EntityActivationState message |
References Plan::Engine::ActionSchedule::onEntityActivationState().
void Plan::Engine::Plan::onFuelLevel | ( | const IMC::FuelLevel * | msg | ) |
Pass FuelLevel to FuelPrediction.
[in] | msg | FuelLevel message |
References Plan::Engine::FuelPrediction::onFuelLevel().
void Plan::Engine::Plan::parse | ( | const std::set< uint16_t > * | supported_maneuvers, |
const std::map< std::string, IMC::EntityInfo > & | cinfo, | ||
IMC::PlanStatistics & | ps, | ||
bool | imu_enabled = false , |
||
const IMC::EstimatedState * | state = NULL |
||
) |
Parse a given plan.
[in] | supported_maneuvers | list of supported maneuvers |
[in] | cinfo | map of components info |
[out] | ps | reference to PlanStatistics message |
[in] | imu_enabled | true if imu enabled, false otherwise |
[in] | state | pointer to EstimatedState message |
References clear().
void Plan::Engine::Plan::planStarted | ( | void | ) |
Signal that the plan has started.
References Plan::Engine::RunTimeStatistics::clear(), Plan::Engine::ActionSchedule::planStarted(), and Plan::Engine::RunTimeStatistics::planStarted().
void Plan::Engine::Plan::planStopped | ( | void | ) |
Signal that the plan has stopped.
References Plan::Engine::RunTimeStatistics::fill(), Plan::Engine::ActionSchedule::planStopped(), and Plan::Engine::RunTimeStatistics::planStopped().
void Plan::Engine::Plan::updateCalibration | ( | const IMC::VehicleState * | vs | ) |
Update calibration process.
References Plan::Engine::RunTimeStatistics::fillCalib(), Plan::Engine::Calibration::forceRemainingTime(), Plan::Engine::Calibration::getElapsedTime(), Plan::Engine::Calibration::inProgress(), Plan::Engine::Calibration::notStarted(), Plan::Engine::Calibration::start(), and Plan::Engine::Calibration::stop().
float Plan::Engine::Plan::updateProgress | ( | const IMC::ManeuverControlState * | mcs | ) |
Get current plan progress.
[in] | mcs | pointer to maneuver control state message |
References Plan::Engine::ActionSchedule::flushTimed(), getETA(), and Plan::Engine::ActionSchedule::updateSchedule().