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

Public Member Functions

 Task (const std::string &name, Tasks::Context &ctx)
 
void onResourceAcquisition (void)
 
bool openSocket (void)
 
void onResourceRelease (void)
 
void onResourceInitialization (void)
 
void consume (const IMC::DevDataText *msg)
 
void consume (const IMC::IoEvent *msg)
 
void clearMessages (void)
 
bool waitInitReply (const std::string &stn)
 
bool readTime (const std::string &str, float &dst)
 
bool readLatitude (const std::string &str, const std::string &h, double &dst)
 
double readLongitude (const std::string &str, const std::string &h, double &dst)
 
template<typename T >
bool readDecimal (const std::string &str, T &dst)
 
template<typename T >
bool readNumber (const std::string &str, T &dst)
 
void processSentence (const std::string &line)
 
void interpretSentence (std::vector< std::string > &parts)
 
bool hasNMEAMessageCode (const std::string &str, const std::string &code)
 
void interpretZDA (const std::vector< std::string > &parts)
 
void interpretGGA (const std::vector< std::string > &parts)
 
void interpretPUBX00 (const std::vector< std::string > &parts)
 
void interpretVTG (const std::vector< std::string > &parts)
 
void interpretHDT (const std::vector< std::string > &parts)
 
void interpretHDM (const std::vector< std::string > &parts)
 
void interpretROT (const std::vector< std::string > &parts)
 
void interpretPSATHPR (const std::vector< std::string > &parts)
 
void onMain (void)
 

Public Attributes

IO::Handle * m_handle
 
IMC::GpsFix m_fix
 
IMC::EulerAngles m_euler
 
IMC::AngularVelocity m_agvel
 
Arguments m_args
 
Time::Counter< float > m_wdog
 
bool m_has_agvel
 
bool m_has_euler
 
std::string m_init_line
 
Readerm_reader
 
char m_bufer_entity [64]
 

Constructor & Destructor Documentation

Member Function Documentation

void Sensors::GPS::Task::clearMessages ( void  )
inline
void Sensors::GPS::Task::consume ( const IMC::DevDataText *  msg)
inline
void Sensors::GPS::Task::consume ( const IMC::IoEvent *  msg)
inline
bool Sensors::GPS::Task::hasNMEAMessageCode ( const std::string &  str,
const std::string &  code 
)
inline
void Sensors::GPS::Task::interpretGGA ( const std::vector< std::string > &  parts)
inline

Interpret GGA sentence (GPS fix data).

Parameters
[in]partsvector of strings from sentence.
void Sensors::GPS::Task::interpretHDM ( const std::vector< std::string > &  parts)
inline

Interpret HDM sentence (Magnetic heading of the vessel derived from the true heading calculated).

Parameters
[in]partsvector of strings from sentence.
void Sensors::GPS::Task::interpretHDT ( const std::vector< std::string > &  parts)
inline

Interpret VTG sentence (true heading).

Parameters
[in]partsvector of strings from sentence.
void Sensors::GPS::Task::interpretPSATHPR ( const std::vector< std::string > &  parts)
inline

Interpret PSATHPR sentence (Proprietary NMEA message that provides the heading, pitch, roll, and time in a single message).

Parameters
[in]partsvector of strings from sentence.
void Sensors::GPS::Task::interpretPUBX00 ( const std::vector< std::string > &  parts)
inline

Interpret PUBX00 sentence (navstar position).

Parameters
[in]partsvector of strings from sentence.
void Sensors::GPS::Task::interpretROT ( const std::vector< std::string > &  parts)
inline

Interpret ROT sentence (rate of turn).

Parameters
[in]partsvector of strings from sentence.
void Sensors::GPS::Task::interpretSentence ( std::vector< std::string > &  parts)
inline

Interpret given sentence.

Parameters
[in]partsvector of strings from sentence.

References Sensors::GPS::Arguments::stn_order.

void Sensors::GPS::Task::interpretVTG ( const std::vector< std::string > &  parts)
inline

Interpret VTG sentence (course over ground).

Parameters
[in]partsvector of strings from sentence.
void Sensors::GPS::Task::interpretZDA ( const std::vector< std::string > &  parts)
inline

Interpret ZDA sentence (UTC date and time).

Parameters
[in]partsvector of strings from sentence.
void Sensors::GPS::Task::onMain ( void  )
inline
void Sensors::GPS::Task::onResourceAcquisition ( void  )
inline
void Sensors::GPS::Task::onResourceInitialization ( void  )
inline
void Sensors::GPS::Task::onResourceRelease ( void  )
inline
bool Sensors::GPS::Task::openSocket ( void  )
inline
void Sensors::GPS::Task::processSentence ( const std::string &  line)
inline

Process sentence.

Parameters
[in]lineline.

References Sensors::GPS::Arguments::stn_order.

template<typename T >
bool Sensors::GPS::Task::readDecimal ( const std::string &  str,
T &  dst 
)
inline

Read decimal from input string.

Parameters
[in]strinput string.
[out]dstdecimal.
Returns
true if successful, false otherwise.
bool Sensors::GPS::Task::readLatitude ( const std::string &  str,
const std::string &  h,
double &  dst 
)
inline

Read latitude from string.

Parameters
[in]strinput string.
[in]heither North (N) or South (S).
[out]dstlatitude.
Returns
true if successful, false otherwise.
double Sensors::GPS::Task::readLongitude ( const std::string &  str,
const std::string &  h,
double &  dst 
)
inline

Read longitude from string.

Parameters
[in]strinput string.
[in]heither West (W) or East (E).
[out]dstlongitude.
Returns
true if successful, false otherwise.
template<typename T >
bool Sensors::GPS::Task::readNumber ( const std::string &  str,
T &  dst 
)
inline

Read number from input string.

Parameters
[in]strinput string.
[out]dstnumber.
Returns
true if successful, false otherwise.
bool Sensors::GPS::Task::readTime ( const std::string &  str,
float &  dst 
)
inline

Read time from string.

Parameters
[in]strstring.
[out]dsttime.
Returns
true if successful, false otherwise.
bool Sensors::GPS::Task::waitInitReply ( const std::string &  stn)
inline

Wait reply to initialization command.

Parameters
[in]stnstring to compare.
Returns
true on successful match, false otherwise.

Member Data Documentation

IMC::AngularVelocity Sensors::GPS::Task::m_agvel

Angular velocity message.

Arguments Sensors::GPS::Task::m_args

Task arguments.

char Sensors::GPS::Task::m_bufer_entity[64]

Buffer forEntityState.

IMC::EulerAngles Sensors::GPS::Task::m_euler

Euler angles message.

IMC::GpsFix Sensors::GPS::Task::m_fix

GPS Fix message.

IO::Handle* Sensors::GPS::Task::m_handle

Serial port handle.

bool Sensors::GPS::Task::m_has_agvel

True if we have angular velocity.

bool Sensors::GPS::Task::m_has_euler

True if we have euler angles.

std::string Sensors::GPS::Task::m_init_line

Last initialization line read.

Reader* Sensors::GPS::Task::m_reader

Reader thread.

Time::Counter<float> Sensors::GPS::Task::m_wdog

Input watchdog.

Collaboration diagram for Sensors::GPS::Task:
Collaboration graph