DUNE: Uniform Navigational Environment  2.4.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)
 
std::vector< double > getHardIronFactors (void)
 
void setHardIronFactors (const std::vector< double > &factors)
 
void decodeOutputData (const UCTK::Frame &frame)
 
void decodeOutputRaw (const UCTK::Frame &frame)
 
void decode (const UCTK::Frame &frame)
 
void readInput (void)
 
void onMain (void)
 

Public Attributes

Arguments m_args
 
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
 
Counter< double > m_wdog
 
ErrorCounts m_err_counts
 

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 decodeOutputData(), decodeOutputRaw(), Sensors::LIMU::PKT_ID_OUTPUT_DATA, and Sensors::LIMU::PKT_ID_OUTPUT_RAW.

Referenced by readInput().

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.

Referenced by decode().

std::vector<double> Sensors::LIMU::Task::getHardIronFactors ( void  )
inline

Get current Hard-Iron calibration parameters.

Returns
hard-iron calibration parameters.

References m_ctl, and Sensors::LIMU::PKT_ID_HARD_IRON.

Referenced by setHardIronFactors().

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

Release resources.

References m_ctl, and m_uart.

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

Read input from sensor.

References decode(), m_buffer, m_frame, m_parser, and m_uart.

Referenced by onMain().

void Sensors::LIMU::Task::setHardIronFactors ( const std::vector< double > &  factors)
inline

Set Hard-Iron calibration parameters.

Parameters
[in]factorsnew calibration values.

References getHardIronFactors(), m_ctl, and Sensors::LIMU::PKT_ID_HARD_IRON.

Referenced by onResourceInitialization(), and onUpdateParameters().

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

Define sensor output frequency.

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

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

Referenced by onResourceInitialization(), and onUpdateParameters().

Member Data Documentation

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

Acceleration.

Referenced by decodeOutputData().

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

Angular velocity.

Referenced by decodeOutputData().

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

Scratch buffer.

Referenced by readInput().

unsigned Sensors::LIMU::Task::m_calib_eid

Compass Calibration maneuver entity id.

UCTK::Interface* Sensors::LIMU::Task::m_ctl
IMC::EulerAnglesDelta Sensors::LIMU::Task::m_delt_ang

Delta angles.

Referenced by decodeOutputData().

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

Delta velocity.

Referenced by decodeOutputData().

ErrorCounts Sensors::LIMU::Task::m_err_counts

Error counts.

Referenced by decodeOutputData().

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

Euler Angles.

Referenced by decodeOutputData().

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

Scratch frame.

Referenced by readInput().

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

Magnetic Field.

Referenced by decodeOutputData().

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

UCTK parser.

Referenced by readInput().

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

Temperature.

Referenced by decodeOutputData().

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

Serial port device.

Referenced by onMain(), onResourceAcquisition(), onResourceRelease(), and readInput().

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

Watchdog.

Referenced by decodeOutputData(), onMain(), and onResourceInitialization().

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