DUNE: Uniform Navigational Environment  2019.02.1
DUNE::Maneuvers::FollowTrajectory Class Referenceabstract

Detailed Description

Base abstract class for trajectory following (IMC::FollowTrajectory maneuver).

Classes

struct  TPoint
 

Public Member Functions

 FollowTrajectory (const std::string &name, Tasks::Context &ctx)
 
virtual ~FollowTrajectory (void)
 
virtual void onUpdateParameters (void)
 
void consume (const IMC::FollowTrajectory *msg)
 
virtual bool canInit (const IMC::FollowTrajectory *msg)=0
 
void consume (const IMC::EstimatedState *msg)
 
virtual void step (const IMC::EstimatedState &state)=0
 
void consume (const IMC::PathControlState *pcs)
 
virtual void onPathCompletion (void)=0
 
void onPathControlState (const IMC::PathControlState *pcs)
 
void onManeuverDeactivation (void)
 
virtual void onReset (void)
 
const TPointpoint (int t_index) const
 
size_t trajectory_points (void) const
 
double controlPeriod (void) const
 
bool isApproaching (void) const
 
void desiredPath (const TPoint &start, const TPoint &end)
 
void desiredSpeed (double value, uint8_t units)
 
- 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
 

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

DUNE::Maneuvers::FollowTrajectory::FollowTrajectory ( const std::string &  name,
Tasks::Context ctx 
)

Constructor.

Parameters
namename.
ctxcontext.
DUNE::Maneuvers::FollowTrajectory::~FollowTrajectory ( void  )
virtual

Destructor.

Member Function Documentation

virtual bool DUNE::Maneuvers::FollowTrajectory::canInit ( const IMC::FollowTrajectory msg)
pure virtual

Method invoked on maneuver startup.

By default the base class implementation does nothing.

Parameters
msgmaneuver message
Returns
true if we can proceed with the maneuver, false otherwise

Referenced by consume().

void DUNE::Maneuvers::FollowTrajectory::consume ( const IMC::EstimatedState msg)

Consumer for IMC::EstimatedState message.

Parameters
msgmessage

References DUNE::IMC::Message::getTimeStamp(), and step().

void DUNE::Maneuvers::FollowTrajectory::consume ( const IMC::PathControlState pcs)

Consumer for IMC::PathControlState message.

Parameters
pcspath control state message
double DUNE::Maneuvers::FollowTrajectory::controlPeriod ( void  ) const
inline

Get control step period.

Returns
control step period.
void DUNE::Maneuvers::FollowTrajectory::desiredSpeed ( double  value,
uint8_t  units 
)
bool DUNE::Maneuvers::FollowTrajectory::isApproaching ( void  ) const
inline

Check if maneuver is still in approach stage (i.e.

moving to the initial point).

Returns
control step period.
void DUNE::Maneuvers::FollowTrajectory::onManeuverDeactivation ( void  )

Method called upon maneuver deactivation.

References onReset().

virtual void DUNE::Maneuvers::FollowTrajectory::onPathCompletion ( void  )
pure virtual

Abstract method called upon path completion.

This will not be called in approach stage (see isApproaching()).

Referenced by onPathControlState().

void DUNE::Maneuvers::FollowTrajectory::onPathControlState ( const IMC::PathControlState pcs)

Inherited from Maneuver class.

Parameters
pcspath control state message

References DUNE::IMC::PathControlState::FL_NEAR, DUNE::IMC::PathControlState::flags, and onPathCompletion().

virtual void DUNE::Maneuvers::FollowTrajectory::onReset ( void  )
inlinevirtual

Method invoked on maneuver reset.

By default the base class implementation does nothing.

Referenced by onManeuverDeactivation().

const TPoint& DUNE::Maneuvers::FollowTrajectory::point ( int  t_index) const
inline

Get a point in the trajectory.

Parameters
t_indexindex of point
Returns
corresponding traj. point
virtual void DUNE::Maneuvers::FollowTrajectory::step ( const IMC::EstimatedState state)
pure virtual

Abstract method invoked for trajectory control.

This will be invoked periodically according to the control step period (see controlPeriod()) after the initial approach stage has concluded (see isApproaching()).

Referenced by consume().

size_t DUNE::Maneuvers::FollowTrajectory::trajectory_points ( void  ) const
inline

Get number of points in the trajetory.

Collaboration diagram for DUNE::Maneuvers::FollowTrajectory:
Collaboration graph