DUNE: Uniform Navigational Environment  2016.09.0
Maneuver::CompassCalibration::Task Struct Reference

Public Member Functions

 Task (const std::string &name, Tasks::Context &ctx)
 
void onUpdateParameters (void)
 
void onResourceRelease (void)
 
void onEntityResolution (void)
 
void onManeuverDeactivation (void)
 
void consume (const IMC::CompassCalibration *maneuver)
 
void consume (const IMC::EstimatedState *msg)
 
void consume (const IMC::EulerAngles *msg)
 
void consume (const IMC::MagneticField *msg)
 
void onPathControlState (const IMC::PathControlState *pcs)
 
void calibrate (bool send_magnetic)
 
void yoyoMotion (bool startup)
 
- Public Member Functions inherited from DUNE::IMC::Message
 Message (void)
 
virtual ~Message (void)
 
virtual Messageclone (void) const =0
 
virtual void clear (void)=0
 
virtual int validate (void) const =0
 
virtual const char * getName (void) const =0
 
virtual uint16_t getId (void) const =0
 
double setTimeStamp (double ts)
 
double setTimeStamp (void)
 
double getTimeStamp (void) const
 
uint16_t getSource (void) const
 
void setSource (uint16_t src)
 
uint8_t getSourceEntity (void) const
 
void setSourceEntity (uint8_t src_ent)
 
uint16_t getDestination (void) const
 
void setDestination (uint16_t dst)
 
uint8_t getDestinationEntity (void) const
 
void setDestinationEntity (uint8_t dst_ent)
 
virtual uint16_t getSubId (void) const
 
virtual void setSubId (uint16_t subid)
 
virtual fp64_t getValueFP (void) const
 
virtual void setValueFP (fp64_t val)
 
unsigned getSerializationSize (void) const
 
unsigned getPayloadSerializationSize (void) const
 
virtual unsigned getFixedSerializationSize (void) const
 
virtual unsigned getVariableSerializationSize (void) const
 
void toJSON (std::ostream &os) const
 
void toText (std::ostream &os) const
 
virtual uint8_t * serializeFields (uint8_t *bfr) const =0
 
virtual uint16_t deserializeFields (const uint8_t *bfr, uint16_t len)=0
 
virtual uint16_t reverseDeserializeFields (const uint8_t *bfr, uint16_t len)=0
 
virtual void fieldsToJSON (std::ostream &os, unsigned indent_level) const
 
bool operator== (const Message &other) const
 
bool operator!= (const Message &other) const
 

Public Attributes

IMC::DesiredPath m_path
 
IMC::DesiredPitch m_pitch
 
IMC::EstimatedState m_estate
 
IMC::MagneticField m_mfield
 
DUNE::Navigation::CompassCalibration m_ccal
 
DUNE::Control::YoYoMotionm_yoyo
 
IMC::ZUnits m_zunits
 
double m_end_time
 
uint16_t m_duration
 
bool m_calibrating
 
bool m_calibrated
 
bool m_dispatched
 
unsigned m_ahrs_eid
 
bool m_yoyo_ing
 
float m_last_psi
 
float m_accum_psi
 
float m_amplitude
 
Arguments m_args
 

Additional Inherited Members

- Protected Member Functions inherited from DUNE::IMC::Message
virtual void setTimeStampNested (double value)
 
virtual void setSourceNested (uint16_t value)
 
virtual void setSourceEntityNested (uint8_t value)
 
virtual void setDestinationNested (uint16_t value)
 
virtual void setDestinationEntityNested (uint8_t value)
 
virtual bool fieldsEqual (const Message &other) const
 
- Protected Attributes inherited from DUNE::IMC::Message
Header m_header
 

Constructor & Destructor Documentation

Member Function Documentation

void Maneuver::CompassCalibration::Task::calibrate ( bool  send_magnetic)
inline

Run compass calibration.

Parameters
[in]send_magneticSend magnetic field parameters.

References Maneuver::CompassCalibration::Arguments::compass_calib, DUNE::Navigation::CompassCalibration::getCalibrationParams(), m_args, m_calibrated, m_ccal, and m_mfield.

Referenced by onManeuverDeactivation(), and onPathControlState().

void Maneuver::CompassCalibration::Task::consume ( const IMC::CompassCalibration *  maneuver)
inline
void Maneuver::CompassCalibration::Task::consume ( const IMC::EstimatedState *  msg)
inline

References m_estate, m_yoyo_ing, and yoyoMotion().

void Maneuver::CompassCalibration::Task::consume ( const IMC::EulerAngles *  msg)
inline
void Maneuver::CompassCalibration::Task::consume ( const IMC::MagneticField *  msg)
inline
void Maneuver::CompassCalibration::Task::onEntityResolution ( void  )
inline
void Maneuver::CompassCalibration::Task::onManeuverDeactivation ( void  )
inline
void Maneuver::CompassCalibration::Task::onPathControlState ( const IMC::PathControlState *  pcs)
inline
void Maneuver::CompassCalibration::Task::onResourceRelease ( void  )
inline

References m_yoyo.

void Maneuver::CompassCalibration::Task::yoyoMotion ( bool  startup)
inline

Yoyo motion update.

Parameters
[in]startupwhether or not the motion is starting right now

References DUNE::Navigation::CompassCalibration::clear(), m_ccal, m_dispatched, m_estate, m_pitch, m_yoyo, m_zunits, and DUNE::Control::YoYoMotion::update().

Referenced by consume(), and onPathControlState().

Member Data Documentation

float Maneuver::CompassCalibration::Task::m_accum_psi

Accumulated psi variation.

Referenced by onManeuverDeactivation(), and onPathControlState().

unsigned Maneuver::CompassCalibration::Task::m_ahrs_eid

AHRS entity id.

Referenced by consume(), and onEntityResolution().

float Maneuver::CompassCalibration::Task::m_amplitude

Yoyo's amplitude.

Referenced by consume(), and onPathControlState().

Arguments Maneuver::CompassCalibration::Task::m_args
bool Maneuver::CompassCalibration::Task::m_calibrated

Already calibrated.

Referenced by calibrate(), consume(), and onManeuverDeactivation().

bool Maneuver::CompassCalibration::Task::m_calibrating

In calibrating phase.

Referenced by consume(), onManeuverDeactivation(), and onPathControlState().

DUNE::Navigation::CompassCalibration Maneuver::CompassCalibration::Task::m_ccal

Compass calibration algorithm.

Referenced by calibrate(), consume(), onUpdateParameters(), and yoyoMotion().

bool Maneuver::CompassCalibration::Task::m_dispatched

True if a pitch message has been dispatched already.

Referenced by consume(), and yoyoMotion().

uint16_t Maneuver::CompassCalibration::Task::m_duration

Duration of the maneuver.

Referenced by consume(), and onPathControlState().

double Maneuver::CompassCalibration::Task::m_end_time

End time of the maneuver.

Referenced by consume(), and onPathControlState().

IMC::EstimatedState Maneuver::CompassCalibration::Task::m_estate

EstimatedState.

Referenced by consume(), onPathControlState(), and yoyoMotion().

float Maneuver::CompassCalibration::Task::m_last_psi

Last value of psi.

Referenced by onPathControlState().

IMC::MagneticField Maneuver::CompassCalibration::Task::m_mfield

Magnetic Field for Compass Calibration.

Referenced by calibrate(), onEntityResolution(), and onManeuverDeactivation().

IMC::DesiredPath Maneuver::CompassCalibration::Task::m_path

Desired Path message.

Referenced by consume(), and onPathControlState().

IMC::DesiredPitch Maneuver::CompassCalibration::Task::m_pitch

Desired Pitch for the maneuver.

Referenced by consume(), and yoyoMotion().

DUNE::Control::YoYoMotion* Maneuver::CompassCalibration::Task::m_yoyo

Yoyo motion controller.

Referenced by consume(), onPathControlState(), onResourceRelease(), and yoyoMotion().

bool Maneuver::CompassCalibration::Task::m_yoyo_ing

Started yoyo movements (not necessarily calibrating)

Referenced by consume(), and onPathControlState().

IMC::ZUnits Maneuver::CompassCalibration::Task::m_zunits

Z units for the maneuver.

Referenced by consume(), and yoyoMotion().

Collaboration diagram for Maneuver::CompassCalibration::Task:
Collaboration graph