DUNE: Uniform Navigational Environment  2.5.1
Navigation::General::Alignment::Task Struct Reference

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 >
Parameterparam (const std::string &name, T &var)
 
template<typename Y , typename T >
Parameterparam (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
Contextm_ctx
 

Constructor & Destructor Documentation

Member Function Documentation

void Navigation::General::Alignment::Task::calibrate ( void  )
inline
bool Navigation::General::Alignment::Task::canCalibrate ( void  )
inline

Perform basic checks.

Returns
true to calibrate, false otherwise.

References m_calibrated, m_dev_active, and m_dev_medium.

Referenced by consume().

void Navigation::General::Alignment::Task::consume ( const IMC::DevCalibrationControl *  msg)
inline
void Navigation::General::Alignment::Task::consume ( const IMC::EntityActivationState *  msg)
inline
void Navigation::General::Alignment::Task::consume ( const IMC::GpsFix *  msg)
inline

References m_gps, and m_lat.

void Navigation::General::Alignment::Task::consume ( const IMC::VehicleMedium *  msg)
inline

References m_dev_medium.

double Navigation::General::Alignment::Task::evaluate ( void  )
inline

Evaluate orientation performance.

void Navigation::General::Alignment::Task::onEntityResolution ( void  )
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().

void Navigation::General::Alignment::Task::onMain ( void  )
inlinevirtual
void Navigation::General::Alignment::Task::onResourceInitialization ( void  )
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().

void Navigation::General::Alignment::Task::onResourceRelease ( void  )
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.

void Navigation::General::Alignment::Task::onUpdateParameters ( void  )
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.

void Navigation::General::Alignment::Task::reset ( void  )
inline

Member Data Documentation

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
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

Minimum calibration time.

Referenced by consume(), and reset().

Time::Counter<float> Navigation::General::Alignment::Task::m_wdog

Watchdog.

Referenced by consume(), onMain(), and onUpdateParameters().

Collaboration diagram for Navigation::General::Alignment::Task:
Collaboration graph