DUNE: Uniform Navigational Environment  2019.02.1
Sensors::LIMU::Task Struct Reference

Public Member Functions

 Task (const std::string &name, Tasks::Context &ctx)
 
void onUpdateParameters (void)
 
void onResourceAcquisition (void)
 
void onResourceRelease (void)
 
void onResourceInitialization (void)
 
void consume (const IMC::MagneticField *msg)
 
void setOutputFrequency (uint8_t frequency)
 
void getHardIronFactors (void)
 
void setHardIronFactors (void)
 
void decodeOutputData (const UCTK::Frame &frame)
 
void decodeOutputRaw (const UCTK::Frame &frame)
 
void decode (const UCTK::Frame &frame)
 
void readInput (void)
 
uint8_t extractRotatedVector (const uint8_t *ptr, Matrix &vector)
 
void reportEntityState (void)
 
void onMain (void)
 

Public Attributes

IMC::AngularVelocity m_ang_vel
 
IMC::Acceleration m_accel
 
IMC::EulerAnglesDelta m_delt_ang
 
IMC::VelocityDelta m_delt_vel
 
IMC::EulerAngles m_euler
 
IMC::MagneticField m_magn
 
IMC::Temperature m_temp
 
SerialPort * m_uart
 
UCTK::Interface * m_ctl
 
UCTK::Parser m_parser
 
UCTK::Frame m_frame
 
uint8_t m_buffer [128]
 
unsigned m_calib_eid
 
Math::Matrix m_rotation
 
Counter< double > m_wdog
 
Counter< double > m_state_timer
 
ErrorCounts m_err_counts
 
double m_hard_iron [c_axes_count]
 
size_t m_sample_count
 
size_t m_faults_count
 
size_t m_timeout_count
 
Arguments m_args
 

Constructor & Destructor Documentation

Member Function Documentation

void Sensors::LIMU::Task::consume ( const IMC::MagneticField *  msg)
inline
void Sensors::LIMU::Task::decode ( const UCTK::Frame &  frame)
inline

Decode data frame.

Parameters
[in]framedata frame.

References Sensors::LIMU::PKT_ID_OUTPUT_DATA, and Sensors::LIMU::PKT_ID_OUTPUT_RAW.

void Sensors::LIMU::Task::decodeOutputData ( const UCTK::Frame &  frame)
inline
void Sensors::LIMU::Task::decodeOutputRaw ( const UCTK::Frame &  frame)
inline

Decode output raw data.

Parameters
[in]frameraw data.
uint8_t Sensors::LIMU::Task::extractRotatedVector ( const uint8_t *  ptr,
Matrix vector 
)
inline
void Sensors::LIMU::Task::getHardIronFactors ( void  )
inline

Get current Hard-Iron calibration parameters.

References Sensors::LIMU::PKT_ID_HARD_IRON.

void Sensors::LIMU::Task::onMain ( void  )
inline
void Sensors::LIMU::Task::onResourceAcquisition ( void  )
inline
void Sensors::LIMU::Task::onResourceInitialization ( void  )
inline

Initialize resources.

References Sensors::LIMU::Arguments::output_frq.

void Sensors::LIMU::Task::onResourceRelease ( void  )
inline

Release resources.

void Sensors::LIMU::Task::readInput ( void  )
inline

Read input from sensor.

void Sensors::LIMU::Task::reportEntityState ( void  )
inline
void Sensors::LIMU::Task::setHardIronFactors ( void  )
inline

Set Hard-Iron calibration parameters.

References Sensors::LIMU::Arguments::hard_iron, and Sensors::LIMU::PKT_ID_HARD_IRON.

void Sensors::LIMU::Task::setOutputFrequency ( uint8_t  frequency)
inline

Define sensor output frequency.

Parameters
[in]frequencydesired frequency.
Returns
true if successful, false otherwise.

References Sensors::LIMU::PKT_ID_OUTPUT_CONF, and Sensors::LIMU::Arguments::raw_data.

Member Data Documentation

IMC::Acceleration Sensors::LIMU::Task::m_accel

Acceleration.

IMC::AngularVelocity Sensors::LIMU::Task::m_ang_vel

Angular velocity.

Arguments Sensors::LIMU::Task::m_args

Task arguments.

uint8_t Sensors::LIMU::Task::m_buffer[128]

Scratch buffer.

unsigned Sensors::LIMU::Task::m_calib_eid

Compass Calibration maneuver entity id.

UCTK::Interface* Sensors::LIMU::Task::m_ctl

Control Interface.

IMC::EulerAnglesDelta Sensors::LIMU::Task::m_delt_ang

Delta angles.

IMC::VelocityDelta Sensors::LIMU::Task::m_delt_vel

Delta velocity.

ErrorCounts Sensors::LIMU::Task::m_err_counts

Error counts.

IMC::EulerAngles Sensors::LIMU::Task::m_euler

Euler Angles.

size_t Sensors::LIMU::Task::m_faults_count

Faults count.

UCTK::Frame Sensors::LIMU::Task::m_frame

Scratch frame.

double Sensors::LIMU::Task::m_hard_iron[c_axes_count]

Rotated hard-iron calibration parameters.

IMC::MagneticField Sensors::LIMU::Task::m_magn

Magnetic Field.

UCTK::Parser Sensors::LIMU::Task::m_parser

UCTK parser.

Math::Matrix Sensors::LIMU::Task::m_rotation

Rotation Matrix to correct mounting position.

size_t Sensors::LIMU::Task::m_sample_count

Sample count.

Counter<double> Sensors::LIMU::Task::m_state_timer

Entity state timer.

IMC::Temperature Sensors::LIMU::Task::m_temp

Temperature.

size_t Sensors::LIMU::Task::m_timeout_count

Timeout count.

SerialPort* Sensors::LIMU::Task::m_uart

Serial port device.

Counter<double> Sensors::LIMU::Task::m_wdog

Watchdog.

Collaboration diagram for Sensors::LIMU::Task:
Collaboration graph