![]() |
DUNE: Uniform Navigational Environment
2.3.2
|
Public Member Functions | |
Task (const std::string &name, Tasks::Context &ctx) | |
~Task (void) | |
void | onResourceAcquisition (void) |
void | onResourceRelease (void) |
void | onResourceInitialization (void) |
void | consume (const IMC::Pulse *msg) |
bool | sendMessage (MessageClass mcl, MessageId mid, const uint8_t *payload, uint16_t size, double timeout=2.0) |
bool | sendMessageWithRetry (MessageClass mcl, MessageId mid, const uint8_t *payload, uint16_t size, double timeout=2.0) |
bool | isClass (uint8_t byte) |
bool | parse (uint8_t byte) |
void | configTimePulse (uint32_t period, unsigned length) |
void | configMessageOutput (MessageClass mcl, MessageId mid, bool on_off=true) |
void | interpret (void) |
void | interpretPOSLLH (void) |
void | interpretVELNED (void) |
void | onMain (void) |
![]() | |
Task (const std::string &name, Context &context) | |
const char * | getName (void) const |
const char * | getSystemName (void) const |
unsigned int | getSystemId (void) const |
unsigned int | getEntityId (void) const |
uint16_t | getActivationTime (void) const |
uint16_t | getDeactivationTime (void) const |
unsigned int | resolveSystemName (const std::string &name) const |
const char * | resolveSystemId (unsigned int id) const |
void | loadConfig (void) |
void | setPriority (unsigned int value) |
unsigned int | getPriority (void) const |
void | inf (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void | war (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void | err (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void void | cri (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void void void | debug (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void void void void | trace (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void void void void void | spew (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void void void void void void | dispatch (IMC::Message *msg, unsigned int flags=0) |
void | dispatch (IMC::Message &msg, unsigned int flags=0) |
void | dispatchReply (const IMC::Message &original, IMC::Message &msg, unsigned int flags=0) |
void | receive (const IMC::Message *msg) |
void | reserveEntities (void) |
void | resolveEntities (void) |
void | acquireResources (void) |
void | releaseResources (void) |
void | initializeResources (void) |
void | updateParameters (bool act_deact=true) |
void | writeParamsXML (std::ostream &os) const |
![]() | |
AbstractTask (void) | |
virtual | ~AbstractTask (void) |
![]() | |
Thread (void) | |
virtual | ~Thread (void) |
![]() | |
Runnable (void) | |
virtual | ~Runnable (void) |
void | start (void) |
void | stop (void) |
void | join (void) |
void | stopAndJoin (void) |
void | setPriority (Scheduler::Policy policy, unsigned priority) |
State | getState (void) |
bool | isCreated (void) |
bool | isStopping (void) |
bool | isRunning (void) |
bool | isStarting (void) |
bool | isDead (void) |
Public Attributes | |
SerialPort * | m_uart |
int | m_iport |
SMStates | m_fsm_state |
int | m_done |
uint8_t | m_cka |
uint8_t | m_ckb |
Packet | m_packet |
IMC::GpsNavData | m_navdata |
Arguments | m_args |
unsigned | m_pps_cal_itr |
IMC::Pulse | m_pulse |
double | m_next_pps |
Static Public Attributes | |
static const unsigned | c_pps_cal_itr |
Additional Inherited Members | |
![]() | |
enum | State { StateStarting, StateRunning, StateStopping, StateDead, StateUnknown } |
![]() | |
static unsigned | native (void) |
![]() | |
const char * | getEntityLabel (void) const |
void | setEntityLabel (const std::string &label) |
void | setEntityState (IMC::EntityState::StateEnum state, Status::Code code) |
void | setEntityState (IMC::EntityState::StateEnum state, const std::string &description) |
IMC::EntityState::StateEnum | getEntityState (void) const |
unsigned int | reserveEntity (const std::string &label) |
unsigned int | resolveEntity (const std::string &label) const |
std::string | resolveEntity (unsigned int id) const |
bool | stopping (void) |
bool | isActive (void) const |
void | waitForMessages (double timeout) |
void | consumeMessages (void) |
template<typename T > | |
Parameter & | param (const std::string &name, T &var) |
template<typename Y , typename T > | |
Parameter & | param (const std::string &name, T &var) |
template<typename T > | |
bool | paramChanged (T &var) |
void | paramActive (Parameter::Scope def_scope, Parameter::Visibility def_visibility, bool def_value=false) |
void | setParamSectionEditor (const std::string &name) |
template<typename M , typename T > | |
void | bind (T *task_obj, void(T::*consumer)(const M *)=&T::consume) |
template<typename T > | |
void | bind (T *task_obj, const std::vector< uint32_t > &list) |
template<typename T > | |
void | bind (T *task_obj, const std::vector< std::string > &list) |
void | requestActivation (void) |
void | requestDeactivation (void) |
void | activate (void) |
void | activationFailed (const std::string &reason) |
void | deactivate (void) |
void | deactivationFailed (const std::string &reason) |
virtual void | onEntityReservation (void) |
virtual void | onEntityResolution (void) |
virtual void | onReportEntityState (void) |
virtual void | onUpdateParameters (void) |
virtual void | onRequestActivation (void) |
virtual void | onRequestDeactivation (void) |
virtual void | onActivation (void) |
virtual void | onDeactivation (void) |
![]() | |
void | startImpl (void) |
void | stopImpl (void) |
void | joinImpl (void) |
void | setPriorityImpl (Scheduler::Policy policy, unsigned priority) |
![]() | |
Context & | m_ctx |
|
inline |
References DUNE::Tasks::Parameter::defaultValue(), Sensors::Antaris4::Arguments::iport, m_args, DUNE::Tasks::Task::param(), Sensors::Antaris4::Arguments::pulse_tol_cal, Sensors::Antaris4::Arguments::pulse_tol_run, Sensors::Antaris4::Arguments::uart_baud, Sensors::Antaris4::Arguments::uart_dev, and DUNE::Tasks::Parameter::units().
|
inlinevirtual |
|
inline |
References Sensors::Antaris4::Arguments::iport, m_args, Sensors::Antaris4::MC_CFG, Sensors::Antaris4::MI_CFG_MSG, and sendMessageWithRetry().
Referenced by onResourceInitialization().
|
inline |
References DUNE::Tasks::Task::dispatch(), Sensors::Antaris4::MC_CFG, Sensors::Antaris4::MI_CFG_TP, and sendMessageWithRetry().
Referenced by consume(), and onResourceInitialization().
|
inline |
|
inline |
|
inline |
References m_navdata, m_packet, and Sensors::Antaris4::Packet::payload.
Referenced by interpret().
|
inline |
References c_pps_cal_itr, DUNE::Tasks::Task::dispatch(), m_navdata, m_packet, m_pps_cal_itr, m_pulse, and Sensors::Antaris4::Packet::payload.
Referenced by interpret().
|
inline |
|
inlinevirtual |
Implements DUNE::Tasks::Task.
References DUNE::Tasks::Task::consumeMessages(), interpret(), m_uart, parse(), and DUNE::Tasks::Task::stopping().
|
inlinevirtual |
Called when the task is instructed to acquire resources whose configuration is defined by run-time parameters.
Reimplemented from DUNE::Tasks::Task.
References m_args, m_uart, Sensors::Antaris4::Arguments::uart_baud, and Sensors::Antaris4::Arguments::uart_dev.
|
inlinevirtual |
Called when the task is instructed to initialize resources acquired previously or whose initialization depends on run-time parameters.
Reimplemented from DUNE::Tasks::Task.
References configMessageOutput(), configTimePulse(), DUNE::Tasks::Task::inf(), Sensors::Antaris4::Arguments::iport, m_args, Sensors::Antaris4::MC_CFG, Sensors::Antaris4::MC_NAV, Sensors::Antaris4::MI_CFG_PRT, Sensors::Antaris4::MI_NAV_POS_LLH, Sensors::Antaris4::MI_NAV_VEL_NED, and sendMessageWithRetry().
|
inlinevirtual |
Called when the task is instructed to release resources.
Derived classes that override this function must not assume that any resource was previously acquired. This function must be implemented in such a way that it can be called at any time.
Reimplemented from DUNE::Tasks::Task.
References m_uart.
Referenced by ~Task().
|
inline |
References Sensors::Antaris4::Packet::cksum_a, Sensors::Antaris4::Packet::cksum_b, DUNE::Tasks::Task::err(), isClass(), Sensors::Antaris4::Packet::length, m_cka, m_ckb, m_done, m_fsm_state, m_packet, Sensors::Antaris4::Packet::mclass, Sensors::Antaris4::Packet::mid, Sensors::Antaris4::Packet::payload, Sensors::Antaris4::SM_STATE_CKA, Sensors::Antaris4::SM_STATE_CKB, Sensors::Antaris4::SM_STATE_CLASS, Sensors::Antaris4::SM_STATE_ID, Sensors::Antaris4::SM_STATE_LENGTH0, Sensors::Antaris4::SM_STATE_LENGTH1, Sensors::Antaris4::SM_STATE_NONE, Sensors::Antaris4::SM_STATE_PAYLOAD, and Sensors::Antaris4::SM_STATE_SYNC1.
Referenced by onMain(), and sendMessage().
|
inline |
References DUNE::Tasks::Task::err(), Sensors::Antaris4::HDR_SYNC0, Sensors::Antaris4::HDR_SYNC1, m_packet, m_uart, Sensors::Antaris4::MC_ACK, Sensors::Antaris4::Packet::mclass, Sensors::Antaris4::MI_ACK_ACK, Sensors::Antaris4::Packet::mid, parse(), and Sensors::Antaris4::Packet::payload.
Referenced by sendMessageWithRetry().
|
inline |
References sendMessage().
Referenced by configMessageOutput(), configTimePulse(), and onResourceInitialization().
|
static |
Referenced by consume(), and interpretVELNED().
Arguments Sensors::Antaris4::Task::m_args |
Referenced by configMessageOutput(), consume(), onResourceAcquisition(), onResourceInitialization(), and Task().
uint8_t Sensors::Antaris4::Task::m_cka |
Referenced by parse().
uint8_t Sensors::Antaris4::Task::m_ckb |
Referenced by parse().
int Sensors::Antaris4::Task::m_done |
Referenced by parse().
int Sensors::Antaris4::Task::m_iport |
IMC::GpsNavData Sensors::Antaris4::Task::m_navdata |
Referenced by interpretPOSLLH(), and interpretVELNED().
double Sensors::Antaris4::Task::m_next_pps |
Referenced by consume().
Packet Sensors::Antaris4::Task::m_packet |
Referenced by interpret(), interpretPOSLLH(), interpretVELNED(), parse(), and sendMessage().
unsigned Sensors::Antaris4::Task::m_pps_cal_itr |
Referenced by consume(), and interpretVELNED().
IMC::Pulse Sensors::Antaris4::Task::m_pulse |
Referenced by consume(), and interpretVELNED().
SerialPort* Sensors::Antaris4::Task::m_uart |
Referenced by onMain(), onResourceAcquisition(), onResourceRelease(), and sendMessage().