![]() |
DUNE: Uniform Navigational Environment
2022.04.0
|
Scheduler for plan and maneuver actions.
Public Member Functions | |
| ActionSchedule (Tasks::Task *task, const IMC::PlanSpecification *spec, const std::vector< IMC::PlanManeuver *> &nodes, const Timeline &tline, const std::map< std::string, IMC::EntityInfo > &cinfo) | |
| ActionSchedule (Tasks::Task *task, const IMC::PlanSpecification *spec, const std::vector< IMC::PlanManeuver *> &nodes, const std::map< std::string, IMC::EntityInfo > &cinfo) | |
| void | updateSchedule (float time_left) |
| void | flushTimed (void) |
| void | planStarted (std::vector< std::string > &affected) |
| void | planStopped (const std::vector< std::string > &affected) |
| void | maneuverStarted (const std::string &id) |
| void | maneuverDone (const std::string &id) |
| float | getEarliestSchedule (void) const |
| bool | onEntityActivationState (const std::string &id, const IMC::EntityActivationState *msg) |
| bool | waitingForDevice (void) |
| float | calibTimeLeft (void) |
| void | fillComponentActiveTime (const std::vector< IMC::PlanManeuver *> &nodes, const Timeline &timeline, ComponentActiveTime &cat) |
| Plan::Engine::ActionSchedule::ActionSchedule | ( | Tasks::Task * | task, |
| const IMC::PlanSpecification * | spec, | ||
| const std::vector< IMC::PlanManeuver *> & | nodes, | ||
| const Timeline & | tline, | ||
| const std::map< std::string, IMC::EntityInfo > & | cinfo | ||
| ) |
Default constructor.
| [in] | task | pointer to task |
| [in] | spec | pointer to PlanSpecification message |
| [in] | nodes | vector of sequential PlanManeuvers that describe the plan |
| [in] | tline | plan timeline with maneuvers' and plan's ETAs |
| [in] | cinfo | map of components info |
References Plan::Engine::Timeline::getExecutionDuration(), Plan::Engine::Timeline::getManeuverEndETA(), and Plan::Engine::Timeline::getManeuverStartETA().
| Plan::Engine::ActionSchedule::ActionSchedule | ( | Tasks::Task * | task, |
| const IMC::PlanSpecification * | spec, | ||
| const std::vector< IMC::PlanManeuver *> & | nodes, | ||
| const std::map< std::string, IMC::EntityInfo > & | cinfo | ||
| ) |
Alternative constructor for when plan is not sequential.
There will be no pre-scheduling using this constructor.
| [in] | task | pointer to task |
| [in] | spec | pointer to PlanSpecification message |
| [in] | nodes | vector of sequential PlanManeuvers that describe the plan |
| [in] | cinfo | map of components info |
| float Plan::Engine::ActionSchedule::calibTimeLeft | ( | void | ) |
Compute a shorter time for calibration.
Referenced by Plan::Engine::Plan::getETA().
| void Plan::Engine::ActionSchedule::fillComponentActiveTime | ( | const std::vector< IMC::PlanManeuver *> & | nodes, |
| const Timeline & | timeline, | ||
| ComponentActiveTime & | cat | ||
| ) |
Fill the object component active time.
| [in] | nodes | vector of sequenced plan maneuvers |
| [in] | timeline | plan timeline with all ETAs |
| [in] | cat | component active time object to fill |
References Plan::Engine::ComponentActiveTime::addActiveTime(), Plan::Engine::ComponentActiveTime::clear(), Plan::Engine::Timeline::getManeuverEndETA(), Plan::Engine::Timeline::getManeuverStartETA(), Plan::Engine::Timeline::getPlanETA(), and Plan::Engine::ComponentActiveTime::subtractActiveTime().
Referenced by Plan::Engine::Plan::getETA().
| void Plan::Engine::ActionSchedule::flushTimed | ( | void | ) |
Flush all remaining timed actions in the schedule.
Referenced by Plan::Engine::Plan::updateProgress().
|
inline |
Get the time of the earliest scheduled action.
References DUNE::Tasks::Task.
Referenced by Plan::Engine::Plan::getETA().
| void Plan::Engine::ActionSchedule::maneuverDone | ( | const std::string & | id | ) |
Maneuver has stopped.
| [in] | id | name of the done maneuver |
Referenced by Plan::Engine::Plan::maneuverDone().
| void Plan::Engine::ActionSchedule::maneuverStarted | ( | const std::string & | id | ) |
Maneuver has started.
| [in] | id | name of the started maneuver |
Referenced by Plan::Engine::Plan::maneuverStarted().
| bool Plan::Engine::ActionSchedule::onEntityActivationState | ( | const std::string & | id, |
| const IMC::EntityActivationState * | msg | ||
| ) |
Check if the activation and deactivation requests are being complied.
| [in] | id | entity label |
| [in] | msg | pointer to EntityActivationState message |
Referenced by Plan::Engine::Plan::onEntityActivationState().
| void Plan::Engine::ActionSchedule::planStarted | ( | std::vector< std::string > & | affected | ) |
The plan has started.
| [out] | affected | vector of entities that will be (de)activated during the plan |
Referenced by Plan::Engine::Plan::planStarted().
| void Plan::Engine::ActionSchedule::planStopped | ( | const std::vector< std::string > & | affected | ) |
The plan has stopped/ended.
| [in] | affected | vector of entities that were (de)activated during last executed plan |
Referenced by Plan::Engine::Plan::planStopped().
| void Plan::Engine::ActionSchedule::updateSchedule | ( | float | time_left | ) |
Update timed actions in schedule.
| [in] | time_left | estimated time left to finish the plan |
Referenced by Plan::Engine::Plan::updateProgress().
| bool Plan::Engine::ActionSchedule::waitingForDevice | ( | void | ) |
Check if we are still waiting for a device in calibration process.
Referenced by Plan::Engine::Plan::getETA().
