DUNE: Uniform Navigational Environment  2.4.2
DUNE::Maneuvers::VehicleFormation Class Referenceabstract

Detailed Description

Abstract base class for vehicle formation maneuver tasks.

Classes

struct  Participant
 
struct  TPoint
 

Public Member Functions

 VehicleFormation (const std::string &name, Tasks::Context &ctx)
 
virtual ~VehicleFormation (void)
 
virtual void onUpdateParameters (void)
 
void consume (const IMC::VehicleFormation *msg)
 
virtual void onInit (const IMC::VehicleFormation *msg)
 
void consume (const IMC::RemoteState *msg)
 
virtual void onUpdate (int index, const IMC::RemoteState &rstate)=0
 
void consume (const IMC::EstimatedState *msg)
 
void consume (const IMC::PathControlState *msg)
 
virtual void onPathCompletion (void)=0
 
virtual void step (const IMC::EstimatedState &state)=0
 
void onManeuverDeactivation (void)
 
virtual void onReset (void)
 
TPoint point (int t_index, int f_index=-1) const
 
size_t trajectory_points (void) const
 
size_t participants () const
 
const Participantparticipant (int index) const
 
const Participantself (void)
 
int formation_index (void) const
 
int formation_index (int addr) const
 
double controlPeriod (void) const
 
bool isApproaching (void) const
 
void desiredPath (const TPoint &start, const TPoint &end, double radius=-1)
 
void desiredSpeed (double value, uint8_t speed_units)
 
void toLocalCoordinates (double lat, double lon, double *x, double *y)
 
- 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::VehicleFormation::VehicleFormation ( const std::string &  name,
Tasks::Context ctx 
)

Constructor.

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

Destructor.

Member Function Documentation

void DUNE::Maneuvers::VehicleFormation::consume ( const IMC::RemoteState msg)

Consumer for IMC::RemoteState message.

Parameters
msgmessage

References DUNE::IMC::Message::getSource().

void DUNE::Maneuvers::VehicleFormation::consume ( const IMC::EstimatedState msg)
void DUNE::Maneuvers::VehicleFormation::consume ( const IMC::PathControlState msg)

Consumer for IMC::PathControlState message.

Parameters
msgpath control state message

References DUNE::IMC::PathControlState::FL_NEAR, and DUNE::IMC::PathControlState::flags.

double DUNE::Maneuvers::VehicleFormation::controlPeriod ( void  ) const
inline

Get control step period.

Returns
control step period.
void DUNE::Maneuvers::VehicleFormation::desiredPath ( const TPoint start,
const TPoint end,
double  radius = -1 
)
void DUNE::Maneuvers::VehicleFormation::desiredSpeed ( double  value,
uint8_t  speed_units 
)
int DUNE::Maneuvers::VehicleFormation::formation_index ( void  ) const
inline

Get index of local vehicle in formation.

Returns
formation index.
int DUNE::Maneuvers::VehicleFormation::formation_index ( int  addr) const
inline

Get index of given IMC address in formation.

Returns
formation index.
bool DUNE::Maneuvers::VehicleFormation::isApproaching ( void  ) const
inline

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

moving to the initial point).

Returns
true if maneuver is in approach state, false otherwise.
virtual void DUNE::Maneuvers::VehicleFormation::onInit ( const IMC::VehicleFormation msg)
inlinevirtual

Method invoked on maneuver startup.

By default the base class implementation does nothing.

Parameters
msgvehicle formation message
void DUNE::Maneuvers::VehicleFormation::onManeuverDeactivation ( void  )

Method called upon maneuver deactivation.

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

Abstract method called upon path completion.

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

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

Method invoked on maneuver reset.

By default the base class implementation does nothing.

virtual void DUNE::Maneuvers::VehicleFormation::onUpdate ( int  index,
const IMC::RemoteState rstate 
)
pure virtual

Abstract method invoked upon a remote state update.

Parameters
indexformation index of remote vehicle
rstatestate of remote vehicle
void DUNE::Maneuvers::VehicleFormation::onUpdateParameters ( void  )
virtual
const Participant& DUNE::Maneuvers::VehicleFormation::participant ( int  index) const
inline

Get configuration of a vehicle in formation.

Parameters
indexformation index
Returns
participant data for specified formation index
size_t DUNE::Maneuvers::VehicleFormation::participants ( ) const
inline

Get number of participants in formation.

Returns
number of participants in formation
VehicleFormation::TPoint DUNE::Maneuvers::VehicleFormation::point ( int  t_index,
int  f_index = -1 
) const

Get a point in the trajectory.

Parameters
t_indexindex of point
f_indexformation index (vehicle)
Returns
corresponding traj. point, optionally displaced by formation index offsets

References DUNE::Coordinates::displace(), DUNE::Coordinates::getBearing(), DUNE::Coordinates::toPolar(), DUNE::Maneuvers::VehicleFormation::TPoint::z, and DUNE::Maneuvers::VehicleFormation::Participant::z.

const Participant& DUNE::Maneuvers::VehicleFormation::self ( void  )
inline

Get configuration of local vehicle in formation.

Returns
participant data for local vehicle
virtual void DUNE::Maneuvers::VehicleFormation::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()).

void DUNE::Maneuvers::VehicleFormation::toLocalCoordinates ( double  lat,
double  lon,
double *  x,
double *  y 
)
size_t DUNE::Maneuvers::VehicleFormation::trajectory_points ( void  ) const
inline

Get number of points in the trajetory.

Collaboration diagram for DUNE::Maneuvers::VehicleFormation:
Collaboration graph