DUNE: Uniform Navigational Environment  2017.01.0
Simulators::LBL::Task Struct Reference

Detailed Description

LBL simulator task.

Public Member Functions

 Task (const std::string &name, Tasks::Context &ctx)
 
void onUpdateParameters (void)
 
void onResourceAcquisition (void)
 
void onResourceRelease (void)
 
bool checkLbl (void) const
 
bool checkGps (void) const
 
bool ready (void) const
 
void reset (void)
 
void consume (const IMC::GpsFix *msg)
 
void consume (const IMC::LblConfig *msg)
 
void consume (const IMC::SimulatedState *msg)
 
void consume (const IMC::UamTxFrame *msg)
 
void onActivation (void)
 
void onDeactivation (void)
 
void range (const std::string &sys_name)
 
void onMain (void)
 

Public Attributes

IMC::SimulatedState m_sstate
 
IMC::GpsFix * m_gps
 
IMC::LblConfig * m_lbl_cfg
 
MessageList< IMC::LblBeacon >
::const_iterator 
m_cursor
 
Counter< double > m_pinger
 
Random::Generatorm_prng
 
Arguments m_args
 

Constructor & Destructor Documentation

Member Function Documentation

bool Simulators::LBL::Task::checkGps ( void  ) const
inline

Check GPS is defined.

Returns
true if GPS is defined, false otherwise.

References m_gps.

Referenced by consume(), and ready().

bool Simulators::LBL::Task::checkLbl ( void  ) const
inline

Check LBL is defined.

Returns
true if LBL is defined, false otherwise.

References m_lbl_cfg.

Referenced by consume(), range(), and ready().

void Simulators::LBL::Task::consume ( const IMC::GpsFix *  msg)
inline

References checkLbl(), m_gps, and reset().

void Simulators::LBL::Task::consume ( const IMC::LblConfig *  msg)
inline

References checkGps(), checkLbl(), m_lbl_cfg, and reset().

void Simulators::LBL::Task::consume ( const IMC::SimulatedState *  msg)
inline

References m_sstate, and ready().

void Simulators::LBL::Task::consume ( const IMC::UamTxFrame *  msg)
inline
void Simulators::LBL::Task::onActivation ( void  )
inline
void Simulators::LBL::Task::onDeactivation ( void  )
inline
void Simulators::LBL::Task::onResourceAcquisition ( void  )
inline
void Simulators::LBL::Task::onResourceRelease ( void  )
inline

Release resources.

References m_gps, m_lbl_cfg, and m_prng.

void Simulators::LBL::Task::onUpdateParameters ( void  )
inline
void Simulators::LBL::Task::range ( const std::string &  sys_name)
inline
bool Simulators::LBL::Task::ready ( void  ) const
inline

Check if we are ready to simulate LBL.

Returns
true if we are ready to simulate, false otherwise.

References checkGps(), checkLbl(), and m_lbl_cfg.

Referenced by consume(), and onMain().

void Simulators::LBL::Task::reset ( void  )
inline

Reset ranger.

References m_cursor, m_lbl_cfg, m_pinger, and DUNE::Time::Counter< T >::reset().

Referenced by consume().

Member Data Documentation

Arguments Simulators::LBL::Task::m_args
MessageList<IMC::LblBeacon>::const_iterator Simulators::LBL::Task::m_cursor

Cursor.

Referenced by onMain(), and reset().

IMC::GpsFix* Simulators::LBL::Task::m_gps

WGS84 origin.

Referenced by checkGps(), consume(), and onResourceRelease().

IMC::LblConfig* Simulators::LBL::Task::m_lbl_cfg

LblConfig buffer.

Referenced by checkLbl(), consume(), onMain(), onResourceRelease(), range(), ready(), and reset().

Counter<double> Simulators::LBL::Task::m_pinger

Next ping time.

Referenced by onActivation(), onMain(), onUpdateParameters(), and reset().

Random::Generator* Simulators::LBL::Task::m_prng

PRNG handle.

Referenced by onResourceAcquisition(), onResourceRelease(), and range().

IMC::SimulatedState Simulators::LBL::Task::m_sstate

Simulated state.

Referenced by consume(), and range().

Collaboration diagram for Simulators::LBL::Task:
Collaboration graph