DUNE: Uniform Navigational Environment
2016.05.0
|
Plan Specification parser.
Classes | |
struct | ParseError |
Public Member Functions | |
Plan (const IMC::PlanSpecification *spec, bool compute_progress, bool fpredict, 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, | ||
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] | 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().
Referenced by Plan::Engine::Task::vehicleRequest().
void Plan::Engine::Plan::clear | ( | void | ) |
Reset data.
References Plan::Engine::Calibration::clear(), and Plan::Engine::ComponentActiveTime::clear().
Referenced by parse(), and Plan::Engine::Task::parsePlan().
|
inline |
Get calibration info string.
Referenced by Plan::Engine::Task::consume().
|
inline |
Get current maneuver id.
Referenced by Plan::Engine::Task::startManeuver().
uint16_t Plan::Engine::Plan::getEstimatedCalibrationTime | ( | void | ) | const |
Get necessary calibration time.
Referenced by Plan::Engine::Task::vehicleRequest().
float Plan::Engine::Plan::getETA | ( | void | ) | const |
Get current estimated time of arrival.
Referenced by Plan::Engine::Task::reportProgress(), and updateProgress().
|
inline |
Has calibration failed.
Referenced by Plan::Engine::Task::consume().
|
inline |
Is calibration done.
Referenced by Plan::Engine::Task::consume().
bool Plan::Engine::Plan::isDone | ( | void | ) | const |
Check if plan has been completed.
Referenced by Plan::Engine::Task::onVehicleManeuver().
IMC::PlanManeuver * Plan::Engine::Plan::loadNextManeuver | ( | void | ) |
Get next maneuver message.
Referenced by Plan::Engine::Task::onVehicleManeuver().
IMC::PlanManeuver * Plan::Engine::Plan::loadStartManeuver | ( | void | ) |
Get start maneuver message.
Referenced by Plan::Engine::Task::consume(), Plan::Engine::Task::onVehicleService(), and Plan::Engine::Task::startPlan().
void Plan::Engine::Plan::maneuverDone | ( | void | ) |
Signal that current maneuver is done.
References Plan::Engine::ActionSchedule::maneuverDone(), and Plan::Engine::RunTimeStatistics::maneuverStopped().
Referenced by Plan::Engine::Task::consume().
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().
Referenced by Plan::Engine::Task::startManeuver().
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().
Referenced by Plan::Engine::Task::consume().
void Plan::Engine::Plan::onFuelLevel | ( | const IMC::FuelLevel * | msg | ) |
Pass FuelLevel to FuelPrediction.
[in] | msg | FuelLevel message |
References Plan::Engine::FuelPrediction::onFuelLevel().
Referenced by Plan::Engine::Task::consume().
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().
Referenced by Plan::Engine::Task::parsePlan().
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().
Referenced by Plan::Engine::Task::startPlan().
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().
Referenced by Plan::Engine::Task::changeMode(), and Plan::Engine::Task::startPlan().
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().
Referenced by Plan::Engine::Task::consume().
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().
Referenced by Plan::Engine::Task::reportProgress().