DUNE: Uniform Navigational Environment
2.5.0
|
Public Member Functions | |
Task (const std::string &name, Tasks::Context &ctx) | |
void | onUpdateParameters (void) |
void | onEntityResolution (void) |
void | onResourceInitialization (void) |
void | onResourceRelease (void) |
void | consume (const IMC::Acceleration *msg) |
void | consume (const IMC::AngularVelocity *msg) |
void | consume (const IMC::DevCalibrationControl *msg) |
void | consume (const IMC::EntityActivationState *msg) |
void | consume (const IMC::GpsFix *msg) |
void | consume (const IMC::VehicleMedium *msg) |
bool | canCalibrate (void) |
void | reset (void) |
void | calibrate (void) |
double | evaluate (void) |
void | onMain (void) |
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 |
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 |
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) |
State | getState (void) |
bool | isCreated (void) |
bool | isStopping (void) |
bool | isRunning (void) |
bool | isStarting (void) |
bool | isDead (void) |
Public Attributes | |
bool | m_dev_medium |
bool | m_dev_active |
bool | m_cmd_calibrate |
bool | m_calibrated |
bool | m_gps |
IMC::EulerAngles | m_euler |
MovingAverage< double > * | m_avg_acc |
unsigned | m_imu_eid |
double | m_lat |
double | m_av_x |
double | m_av_y |
double | m_av_z |
unsigned | m_av_readings |
double | m_acc_x |
double | m_acc_y |
double | m_acc_z |
unsigned | m_acc_readings |
Time::Counter< float > | m_time |
Time::Counter< float > | m_delay |
Time::Counter< float > | m_wdog |
Arguments | m_args |
Additional Inherited Members | |
Public Types inherited from DUNE::Concurrency::Runnable | |
enum | State { StateStarting, StateRunning, StateStopping, StateDead, StateUnknown } |
Protected Member Functions inherited from DUNE::Tasks::Task | |
const char * | getEntityLabel (void) const |
void | setEntityLabel (const std::string &label) |
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) |
unsigned int | resolveEntity (const std::string &label) const |
std::string | resolveEntity (unsigned int id) const |
bool | stopping (void) |
bool | isActive (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 > | |
void | bind (T *task_obj, const std::vector< std::string > &list) |
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 void | onEntityReservation (void) |
virtual void | onReportEntityState (void) |
virtual void | onResourceAcquisition (void) |
virtual void | onRequestActivation (void) |
virtual void | onRequestDeactivation (void) |
virtual void | onActivation (void) |
virtual void | onDeactivation (void) |
Protected Member Functions inherited from DUNE::Concurrency::Thread | |
void | startImpl (void) |
void | stopImpl (void) |
void | joinImpl (void) |
void | setPriorityImpl (Scheduler::Policy policy, unsigned priority) |
Protected Attributes inherited from DUNE::Tasks::Task | |
Context & | m_ctx |
|
inline |
References Navigation::General::Alignment::Arguments::avg_samples, DUNE::Tasks::Parameter::defaultValue(), Navigation::General::Alignment::Arguments::delay, Navigation::General::Alignment::Arguments::elabel_imu, m_args, m_calibrated, DUNE::Tasks::Task::param(), DUNE::Tasks::Task::setEntityState(), Navigation::General::Alignment::Arguments::start_at_boot, Navigation::General::Alignment::Arguments::std, Navigation::General::Alignment::Arguments::time, DUNE::Tasks::Parameter::units(), and Navigation::General::Alignment::Arguments::wdog.
|
inline |
Calibrate orientation by means of computing current compass heading bias.
References m_acc_readings, m_acc_x, m_acc_y, m_acc_z, m_av_readings, m_av_x, m_av_y, m_av_z, m_euler, DUNE::Math::Matrix::norm_2(), DUNE::Math::Matrix::resizeAndFill(), DUNE::Math::Matrix::set(), DUNE::Tasks::Task::spew(), DUNE::Math::Matrix::toEulerAngles(), and DUNE::Math::transpose().
Referenced by consume().
|
inline |
Perform basic checks.
References m_calibrated, m_dev_active, and m_dev_medium.
Referenced by consume().
|
inline |
References canCalibrate(), DUNE::Tasks::Task::getEntityState(), m_acc_readings, m_acc_x, m_acc_y, m_acc_z, m_args, m_avg_acc, m_cmd_calibrate, m_delay, m_imu_eid, DUNE::Tasks::Task::setEntityState(), Navigation::General::Alignment::Arguments::start_at_boot, Navigation::General::Alignment::Arguments::std, DUNE::Math::MovingAverage< T >::stdev(), and DUNE::Math::MovingAverage< T >::update().
|
inline |
References calibrate(), canCalibrate(), DUNE::Tasks::Task::dispatch(), DUNE::Tasks::Task::getEntityState(), m_args, m_av_readings, m_av_x, m_av_y, m_av_z, m_calibrated, m_cmd_calibrate, m_delay, m_euler, m_gps, m_imu_eid, m_time, m_wdog, reset(), DUNE::Tasks::Task::setEntityState(), and Navigation::General::Alignment::Arguments::start_at_boot.
|
inline |
|
inline |
References m_calibrated, m_dev_active, m_imu_eid, and DUNE::Tasks::Task::setEntityState().
|
inline |
|
inline |
References m_dev_medium.
|
inline |
Evaluate orientation performance.
|
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 Navigation::General::Alignment::Arguments::elabel_imu, m_args, m_imu_eid, DUNE::Tasks::Task::resolveEntity(), and DUNE::Tasks::Task::war().
|
inlinevirtual |
Implements DUNE::Tasks::Task.
References m_calibrated, m_wdog, DUNE::Tasks::Task::setEntityState(), DUNE::Tasks::Task::stopping(), and DUNE::Tasks::Task::waitForMessages().
|
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 Navigation::General::Alignment::Arguments::avg_samples, m_args, m_avg_acc, m_delay, and reset().
|
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.
References m_avg_acc.
|
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 Navigation::General::Alignment::Arguments::delay, m_args, m_delay, m_wdog, and Navigation::General::Alignment::Arguments::wdog.
|
inline |
Reset internal parameters.
References Navigation::General::Alignment::Arguments::delay, m_acc_readings, m_acc_x, m_acc_y, m_acc_z, m_args, m_av_readings, m_av_x, m_av_y, m_av_z, m_delay, m_time, and Navigation::General::Alignment::Arguments::time.
Referenced by consume(), and onResourceInitialization().
unsigned Navigation::General::Alignment::Task::m_acc_readings |
Number of Acceleration readings.
Referenced by calibrate(), consume(), and reset().
double Navigation::General::Alignment::Task::m_acc_x |
Accumulator for x-axis acceleration.
Referenced by calibrate(), consume(), and reset().
double Navigation::General::Alignment::Task::m_acc_y |
Accumulator for y-axis acceleration.
Referenced by calibrate(), consume(), and reset().
double Navigation::General::Alignment::Task::m_acc_z |
Accumulator for z-axis acceleration.
Referenced by calibrate(), consume(), and reset().
Arguments Navigation::General::Alignment::Task::m_args |
Task arguments.
Referenced by consume(), onEntityResolution(), onResourceInitialization(), onUpdateParameters(), reset(), and Task().
unsigned Navigation::General::Alignment::Task::m_av_readings |
Number of Angular Velocity readings.
Referenced by calibrate(), consume(), and reset().
double Navigation::General::Alignment::Task::m_av_x |
Accumulator for x-axis angular velocity.
Referenced by calibrate(), consume(), and reset().
double Navigation::General::Alignment::Task::m_av_y |
Accumulator for y-axis angular velocity.
Referenced by calibrate(), consume(), and reset().
double Navigation::General::Alignment::Task::m_av_z |
Accumulator for z-axis angular velocity.
Referenced by calibrate(), consume(), and reset().
MovingAverage<double>* Navigation::General::Alignment::Task::m_avg_acc |
Moving average for acceleration vector.
Referenced by consume(), onResourceInitialization(), and onResourceRelease().
bool Navigation::General::Alignment::Task::m_calibrated |
Device calibrated.
Referenced by canCalibrate(), consume(), onMain(), and Task().
bool Navigation::General::Alignment::Task::m_cmd_calibrate |
Received order to calibrate.
Referenced by consume().
Time::Counter<float> Navigation::General::Alignment::Task::m_delay |
Initial delay time.
Referenced by consume(), onResourceInitialization(), onUpdateParameters(), and reset().
bool Navigation::General::Alignment::Task::m_dev_active |
Device is activated.
Referenced by canCalibrate(), and consume().
bool Navigation::General::Alignment::Task::m_dev_medium |
Device is proper medium.
Referenced by canCalibrate(), and consume().
IMC::EulerAngles Navigation::General::Alignment::Task::m_euler |
Euler Angles calibrated.
Referenced by calibrate(), and consume().
bool Navigation::General::Alignment::Task::m_gps |
GpsFix received.
Referenced by consume().
unsigned Navigation::General::Alignment::Task::m_imu_eid |
IMU entity id.
Referenced by consume(), and onEntityResolution().
double Navigation::General::Alignment::Task::m_lat |
Vehicle WGS-84 latitude.
Referenced by consume().
Time::Counter<float> Navigation::General::Alignment::Task::m_time |
Time::Counter<float> Navigation::General::Alignment::Task::m_wdog |
Watchdog.
Referenced by consume(), onMain(), and onUpdateParameters().