DUNE: Uniform Navigational Environment
2020.01.0
|
Public Member Functions | |
Task (const std::string &name, Tasks::Context &ctx) | |
void | onEntityResolution (void) |
void | onUpdateParameters (void) |
void | onResourceRelease (void) |
void | onResourceAcquisition (void) |
void | onResourceInitialization (void) |
void | consume (const IMC::EstimatedState *msg) |
void | consume (const IMC::ManeuverControlState *msg) |
void | consume (const IMC::RegisterManeuver *msg) |
void | consume (const IMC::EntityInfo *msg) |
void | consume (const IMC::EntityActivationState *msg) |
void | consume (const IMC::FuelLevel *msg) |
void | consume (const IMC::VehicleCommand *vc) |
void | consume (const IMC::VehicleState *vs) |
void | onVehicleService (const IMC::VehicleState *vs) |
void | onVehicleManeuver (const IMC::VehicleState *vs) |
void | onVehicleError (const IMC::VehicleState *vs) |
void | onVehicleCalibration (const IMC::VehicleState *vs) |
void | onVehicleExternalControl (const IMC::VehicleState *vs) |
void | consume (const IMC::PlanControl *pc) |
void | processRequest (const IMC::PlanControl *pc) |
bool | loadPlan (const std::string &plan_id, const IMC::Message *arg, bool plan_startup=false) |
void | getPlan (void) |
bool | stopPlan (bool plan_startup=false) |
bool | parsePlan (bool plan_startup, IMC::PlanStatistics &ps) |
bool | lookForPlan (const std::string &plan_id, IMC::PlanSpecification &ps) |
bool | parseArg (const std::string &plan_id, const IMC::Message *arg, std::string &info) |
bool | startPlan (const std::string &plan_id, const IMC::Message *spec, uint16_t flags) |
bool | startCalibration (void) |
void | startManeuver (IMC::PlanManeuver *pman) |
void | answer (uint8_t type, const std::string &desc, bool print=true) |
void | onFailure (const std::string &errmsg, bool print=true) |
void | onSuccess (const std::string &msg=DTR("OK"), bool print=true) |
void | changeMode (IMC::PlanControlState::StateEnum s, const std::string &event_desc, const std::string &nid, const IMC::Message *maneuver, OutputType print=TYPE_WAR) |
void | changeMode (IMC::PlanControlState::StateEnum s, const std::string &event_desc, OutputType print=TYPE_WAR) |
void | setInitialState (void) |
void | reportProgress (void) |
void | onMain (void) |
void | vehicleRequest (IMC::VehicleCommand::CommandEnum command, const IMC::Message *arg=0) |
bool | pendingReply (void) |
bool | blockedMode (void) const |
bool | readyMode (void) const |
bool | initMode (void) const |
bool | execMode (void) const |
void | changeLog (const std::string &name) |
Public Member Functions inherited from DUNE::Tasks::Task | |
Task (const std::string &name, Context &context) | |
virtual | ~Task (void) |
const char * | getName (void) const |
const char * | getSystemName (void) const |
unsigned int | getSystemId (void) const |
unsigned int | getEntityId (void) const |
unsigned int | resolveEntity (const std::string &label) const |
std::string | resolveEntity (unsigned int id) const |
DebugLevel | getDebugLevel (void) const |
uint16_t | getActivationTime (void) const |
uint16_t | getDeactivationTime (void) const |
unsigned int | resolveSystemName (const std::string &name) const |
const char * | resolveSystemId (unsigned int id) const |
void | loadConfig (void) |
void | setPriority (unsigned int value) |
unsigned int | getPriority (void) const |
void | inf (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void | war (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void | err (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void void | cri (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void void void | debug (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void void void void | trace (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void void void void void | spew (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void void void void void void | dispatch (IMC::Message *msg, unsigned int flags=0) |
void | dispatch (IMC::Message &msg, unsigned int flags=0) |
void | dispatchReply (const IMC::Message &original, IMC::Message &msg, unsigned int flags=0) |
void | receive (const IMC::Message *msg) |
void | reserveEntities (void) |
void | resolveEntities (void) |
void | acquireResources (void) |
void | releaseResources (void) |
void | initializeResources (void) |
void | updateParameters (bool act_deact=true) |
void | writeParamsXML (std::ostream &os) const |
const char * | getEntityLabel (void) const |
void | setEntityLabel (const std::string &label) |
Public Member Functions inherited from DUNE::Tasks::AbstractTask | |
AbstractTask (void) | |
virtual | ~AbstractTask (void) |
Public Member Functions inherited from DUNE::Concurrency::Thread | |
Thread (void) | |
virtual | ~Thread (void) |
int | getProcessorUsage (void) |
Public Member Functions inherited from DUNE::Concurrency::Runnable | |
Runnable (void) | |
virtual | ~Runnable (void) |
void | start (void) |
void | stop (void) |
void | join (void) |
void | stopAndJoin (void) |
void | setPriority (Scheduler::Policy policy, unsigned priority) |
unsigned | getPriority (void) |
State | getState (void) |
bool | isCreated (void) |
bool | isStopping (void) |
bool | isRunning (void) |
bool | isStarting (void) |
bool | isDead (void) |
Public Attributes | |
Plan * | m_plan |
IMC::PlanControlState | m_pcs |
IMC::PlanControl | m_reply |
std::string | m_last_event |
uint16_t | m_vreq_ctr |
double | m_vc_reply_deadline |
double | m_last_vstate |
IMC::VehicleCommand | m_vc |
IMC::PlanSpecification | m_spec |
std::set< uint16_t > | m_supported_maneuvers |
IMC::LoggingControl | m_lc |
IMC::EstimatedState | m_state |
IMC::ManeuverControlState | m_mcs |
Time::Counter< float > | m_report_timer |
std::map< std::string, IMC::EntityInfo > | m_cinfo |
unsigned | m_eid_imu |
unsigned | m_eid_gen |
bool | m_imu_enabled |
std::queue< IMC::PlanControl > | m_requests |
Path | m_db_file |
Arguments | m_args |
Additional Inherited Members | |
Public Types inherited from DUNE::Concurrency::Runnable | |
Protected Member Functions inherited from DUNE::Tasks::Task | |
void | setEntityState (IMC::EntityState::StateEnum state, Status::Code code) |
void | setEntityState (IMC::EntityState::StateEnum state, const std::string &description) |
IMC::EntityState::StateEnum | getEntityState (void) const |
unsigned int | reserveEntity (const std::string &label) |
template<typename E > | |
E * | reserveEntity (const std::string &label) |
Entities::BasicEntity * | getLocalEntity (const std::string &label) |
bool | stopping (void) |
bool | isActive (void) const |
bool | isActivating (void) const |
bool | isDeactivating (void) const |
void | waitForMessages (double timeout) |
void | consumeMessages (void) |
template<typename T > | |
Parameter & | param (const std::string &name, T &var) |
template<typename Y , typename T > | |
Parameter & | param (const std::string &name, T &var) |
template<typename T > | |
bool | paramChanged (T &var) |
void | paramActive (Parameter::Scope def_scope, Parameter::Visibility def_visibility, bool def_value=false) |
void | setParamSectionEditor (const std::string &name) |
template<typename M , typename T > | |
void | bind (T *task_obj, void(T::*consumer)(const M *)=&T::consume) |
template<typename T > | |
void | bind (T *task_obj, const std::vector< uint32_t > &list) |
template<typename T , typename M > | |
void | bind (T *task_obj, const std::vector< uint32_t > &list, void(T::*consumer)(const M *)=&T::consume) |
template<typename T > | |
void | bind (T *task_obj, const std::vector< std::string > &list) |
void | bind (unsigned int message_id, AbstractConsumer *consumer) |
void | requestActivation (void) |
void | requestDeactivation (void) |
void | activate (void) |
void | activationFailed (const std::string &reason) |
void | deactivate (void) |
void | deactivationFailed (const std::string &reason) |
virtual bool | onWriteParamsXML (std::ostream &os) const |
virtual void | onEntityReservation (void) |
virtual void | onReportEntityState (void) |
virtual void | onRequestActivation (void) |
virtual void | onRequestDeactivation (void) |
virtual void | onActivation (void) |
virtual void | onDeactivation (void) |
virtual void | onQueryEntityParameters (const IMC::QueryEntityParameters *msg) |
virtual void | onSetEntityParameters (const IMC::SetEntityParameters *msg) |
virtual void | onPushEntityParameters (const IMC::PushEntityParameters *msg) |
virtual void | onPopEntityParameters (const IMC::PopEntityParameters *msg) |
Protected Member Functions inherited from DUNE::Concurrency::Thread | |
void | startImpl (void) |
void | stopImpl (void) |
void | joinImpl (void) |
void | setPriorityImpl (Scheduler::Policy policy, unsigned priority) |
unsigned | getPriorityImpl (void) |
Protected Attributes inherited from DUNE::Tasks::Task | |
Context & | m_ctx |
std::vector< Entities::BasicEntity * > | m_entities |
|
inline |
References Plan::Engine::Arguments::actfail_abort, Plan::Engine::Arguments::calibration_time, Plan::Engine::Arguments::do_calib, Plan::Engine::Arguments::fpredict, Plan::Engine::Arguments::label_gen, Plan::Engine::Arguments::label_imu, Plan::Engine::Arguments::max_depth, Plan::Engine::Arguments::progress, Plan::Engine::Arguments::recovery_plan, Plan::Engine::Arguments::sk_calib, Plan::Engine::Arguments::sk_radius, Plan::Engine::Arguments::sk_rpm, and Plan::Engine::Arguments::speriod.
|
inline |
Answer to the plan control request.
[in] | type | type of reply (same field as plan control message) |
[in] | desc | description for the answer |
[in] | true if output should be printed out |
|
inline |
|
inline |
|
inline |
Change the current plan control state mode.
[in] | s | plan control state to switch to |
[in] | event_desc | description of the event that motivated the change |
[in] | nid | id of the maneuver if any |
[in] | maneuver | pointer to maneuver message |
[in] | true if the messages should be printed to output |
References Plan::Engine::TYPE_INF, and Plan::Engine::TYPE_WAR.
|
inline |
Change the current plan control state mode.
[in] | s | plan control state to switch to |
[in] | event_desc | description of the event that motivated the change |
[in] | true if the messages should be printed to output |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References Plan::Engine::Arguments::actfail_abort, and Plan::Engine::TYPE_NONE.
|
inline |
|
inline |
References Plan::Engine::TYPE_NONE.
|
inline |
|
inline |
References Plan::Engine::Arguments::recovery_plan.
|
inline |
|
inline |
Get current plan.
|
inline |
|
inline |
Load a plan into the vehicle.
[in] | plan_id | name of the plan |
[in] | arg | argument which may either be a maneuver or a plan specification |
[in] | plan_startup | true if a plan will start right after |
|
inline |
Look for a plan in the database.
[in] | plan_id | name of the plan |
[in] | ps | plan specification message |
|
inlinevirtual |
Called when the task is instructed to resolve all the entity identifiers it needs for normal execution.
See resolveEntity(). Derived classes that need to resolve entity identifiers should override this function.
Reimplemented from DUNE::Tasks::Task.
References Plan::Engine::Arguments::label_gen, and Plan::Engine::Arguments::label_imu.
|
inline |
Answer to the reply with a failure message.
[in] | errmsg | text error message to send |
[in] | true if the message should be printed to output |
|
inlinevirtual |
Implements DUNE::Tasks::Task.
References Plan::Engine::Arguments::progress.
|
inlinevirtual |
Called when the task is instructed to acquire resources whose configuration is defined by run-time parameters.
Reimplemented from DUNE::Tasks::Task.
References Plan::Engine::Arguments::calibration_time, Plan::Engine::Arguments::fpredict, Plan::Engine::Arguments::max_depth, Plan::Engine::Plan, and Plan::Engine::Arguments::progress.
|
inlinevirtual |
Called when the task is instructed to initialize resources acquired previously or whose initialization depends on run-time parameters.
Reimplemented from DUNE::Tasks::Task.
References Plan::Engine::Arguments::speriod.
|
inlinevirtual |
Called when the task is instructed to release resources.
Derived classes that override this function must not assume that any resource was previously acquired. This function must be implemented in such a way that it can be called at any time.
Reimplemented from DUNE::Tasks::Task.
|
inline |
Answer to the reply with a success message.
[in] | msg | text message to send |
[in] | true if the message should be printed to output |
|
inlinevirtual |
Called when the task is instructed to update its run-time parameters.
Derived classes that need to compute auxiliary values based on run-time parameters should override this function.
Reimplemented from DUNE::Tasks::Task.
References Plan::Engine::Arguments::calibration_time, Plan::Engine::Arguments::progress, and Plan::Engine::Arguments::speriod.
|
inline |
References Plan::Engine::TYPE_NONE.
|
inline |
References Plan::Engine::TYPE_NONE.
|
inline |
References Plan::Engine::TYPE_NONE.
|
inline |
References Plan::Engine::TYPE_INF.
|
inline |
References Plan::Engine::TYPE_INF.
|
inline |
Get the PlanSpecification from IMC::Message.
[in] | plan_id | ID of the plan |
[in] | arg | pointer to arg message |
[out] | info | string with the error in case of failure |
|
inline |
Parse a given plan.
[in] | plan_startup | true if the plan is starting up |
[out] | ps | reference to PlanStatistics message |
|
inline |
|
inline |
|
inline |
|
inline |
Report progress.
|
inline |
Set task's initial state.
|
inline |
Send a request to start calibration procedures.
References Plan::Engine::Arguments::sk_calib, Plan::Engine::Arguments::sk_radius, and Plan::Engine::Arguments::sk_rpm.
|
inline |
Start a maneuver by name.
[in] | pman | pointer to plan maneuver message |
References Plan::Engine::TYPE_INF.
|
inline |
Start a given plan.
[in] | plan_id | name of the plan to execute |
[in] | spec | plan specification message if any |
[in] | flags | plan control flags |
References Plan::Engine::Arguments::do_calib, and Plan::Engine::TYPE_INF.
|
inline |
Stop current plan being executed.
[in] | plan_startup | true if a plan will start right after this stop |
References Plan::Engine::TYPE_INF.
|
inline |
References Plan::Engine::c_vc_reply_timeout.
std::map<std::string, IMC::EntityInfo> Plan::Engine::Task::m_cinfo |
Map of component names to entityinfo.
Path Plan::Engine::Task::m_db_file |
Plan database file.
unsigned Plan::Engine::Task::m_eid_gen |
Source entity of the plan generator.
unsigned Plan::Engine::Task::m_eid_imu |
Source entity of the IMU.
bool Plan::Engine::Task::m_imu_enabled |
IMU is enabled or not.
std::string Plan::Engine::Task::m_last_event |
Last event description.
double Plan::Engine::Task::m_last_vstate |
IMC::LoggingControl Plan::Engine::Task::m_lc |
Misc.
IMC::ManeuverControlState Plan::Engine::Task::m_mcs |
ManeuverControlState message.
IMC::PlanControlState Plan::Engine::Task::m_pcs |
Plan control interface.
IMC::PlanControl Plan::Engine::Task::m_reply |
Time::Counter<float> Plan::Engine::Task::m_report_timer |
Timer counter for state report period.
std::queue<IMC::PlanControl> Plan::Engine::Task::m_requests |
Queue of PlanControl messages.
IMC::PlanSpecification Plan::Engine::Task::m_spec |
PlanSpecification message.
IMC::EstimatedState Plan::Engine::Task::m_state |
std::set<uint16_t> Plan::Engine::Task::m_supported_maneuvers |
List of supported maneuvers.
IMC::VehicleCommand Plan::Engine::Task::m_vc |
double Plan::Engine::Task::m_vc_reply_deadline |
uint16_t Plan::Engine::Task::m_vreq_ctr |
Vehicle interface.