DUNE: Uniform Navigational Environment  2019.02.1
Maneuver::FollowReference::UAV::Task Struct Reference

Public Member Functions

 Task (const std::string &name, Tasks::Context &ctx)
 
void consume (const IMC::FollowReference *msg)
 
void consume (const IMC::Reference *msg)
 
void consume (const IMC::EstimatedState *msg)
 
void onPathControlState (const IMC::PathControlState *pcs)
 
bool sameReference (const IMC::Reference *msg1, const IMC::Reference *msg2)
 
IMC::SpeedUnits parseSpeedUnitsStr (std::string sunits_str)
 
void processDesiredPath (void)
 
void enableMovement (bool enable)
 
void updateEndLoc (void)
 
void updateSpeed (void)
 
void updateRadius (void)
 
void updateEndZ (void)
 
int initializeEndZ (void)
 
void updateCoordinates (void)
 
void dispatchDesiredPath (void)
 
void updateFollowRefStateFlags (void)
 
void checkTimeout (void)
 
bool offlineOrWaiting (void)
 
void onDeactivation (void)
 
- 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::FollowReference m_spec
 
IMC::Reference m_cur_ref
 
double m_last_ref_time
 
IMC::EstimatedState m_estate
 
IMC::PathControlState m_pcs
 
IMC::FollowRefState m_fref_state
 
IMC::DesiredPath m_desired_path
 
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::FollowReference::UAV::Task::checkTimeout ( void  )
inline

Check timeout.

void Maneuver::FollowReference::UAV::Task::consume ( const IMC::FollowReference *  msg)
inline
void Maneuver::FollowReference::UAV::Task::consume ( const IMC::Reference *  msg)
inline
void Maneuver::FollowReference::UAV::Task::consume ( const IMC::EstimatedState *  msg)
inline
void Maneuver::FollowReference::UAV::Task::dispatchDesiredPath ( void  )
inline

Dispatch desired path message.

void Maneuver::FollowReference::UAV::Task::enableMovement ( bool  enable)
inline

Function for enabling and disabling the control loops.

int Maneuver::FollowReference::UAV::Task::initializeEndZ ( void  )
inline

Initialize end z.

Returns
desired height.

References Maneuver::FollowReference::UAV::Arguments::default_z.

bool Maneuver::FollowReference::UAV::Task::offlineOrWaiting ( void  )
inline

Check if follow reference state has either timed out or is waiting.

Returns
true if timed out or waiting, false otherwise.
void Maneuver::FollowReference::UAV::Task::onDeactivation ( void  )
inline
void Maneuver::FollowReference::UAV::Task::onPathControlState ( const IMC::PathControlState *  pcs)
inline
IMC::SpeedUnits Maneuver::FollowReference::UAV::Task::parseSpeedUnitsStr ( std::string  sunits_str)
inline

Parse speed units string.

Parameters
[in]sunits_strspeed units string.
Returns
desired speed units.
void Maneuver::FollowReference::UAV::Task::processDesiredPath ( void  )
inline

Generate and dispatch a DesiredPath based on the received reference.

bool Maneuver::FollowReference::UAV::Task::sameReference ( const IMC::Reference *  msg1,
const IMC::Reference *  msg2 
)
inline

Check if references are equal.

Parameters
[in]msg1reference message.
[in]msg2reference message.
Returns
true if references are equal, false otherwise.
void Maneuver::FollowReference::UAV::Task::updateCoordinates ( void  )
inline

Update desired path's coordinates.

void Maneuver::FollowReference::UAV::Task::updateEndLoc ( void  )
inline

Update desired path's end location.

void Maneuver::FollowReference::UAV::Task::updateEndZ ( void  )
inline

Update desired path's end z.

void Maneuver::FollowReference::UAV::Task::updateFollowRefStateFlags ( void  )
inline

Update follow reference state flags.

void Maneuver::FollowReference::UAV::Task::updateRadius ( void  )
inline

Update desired path's radius.

References Maneuver::FollowReference::UAV::Arguments::loitering_radius.

void Maneuver::FollowReference::UAV::Task::updateSpeed ( void  )
inline

Member Data Documentation

Arguments Maneuver::FollowReference::UAV::Task::m_args

Task arguments.

IMC::Reference Maneuver::FollowReference::UAV::Task::m_cur_ref

Store latest received reference and the one before that.

IMC::DesiredPath Maneuver::FollowReference::UAV::Task::m_desired_path

Desired path message.

IMC::EstimatedState Maneuver::FollowReference::UAV::Task::m_estate

Estimated state.

IMC::FollowRefState Maneuver::FollowReference::UAV::Task::m_fref_state

Follow Reference state.

double Maneuver::FollowReference::UAV::Task::m_last_ref_time

Store last timestamp when reference was received.

IMC::PathControlState Maneuver::FollowReference::UAV::Task::m_pcs

Path Control state.

IMC::FollowReference Maneuver::FollowReference::UAV::Task::m_spec

Store maneuver specification.

Collaboration diagram for Maneuver::FollowReference::UAV::Task:
Collaboration graph