DUNE: Uniform Navigational Environment
2019.02.0
|
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 | onPathControlState (const IMC::PathControlState *pcs) |
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 Participant & | participant (int index) const |
const Participant & | self (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 Message * | clone (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 |
DUNE::Maneuvers::VehicleFormation::VehicleFormation | ( | const std::string & | name, |
Tasks::Context & | ctx | ||
) |
Constructor.
name | name. |
ctx | context. |
|
virtual |
Destructor.
void DUNE::Maneuvers::VehicleFormation::consume | ( | const IMC::VehicleFormation * | msg | ) |
Consumer for IMC::VehicleFormation message.
msg | vehicle formation message |
References DUNE::IMC::CL_PATH, DUNE::Coordinates::displace(), DUNE::Coordinates::WGS84::displace(), DUNE::IMC::VehicleFormation::lat, DUNE::IMC::VehicleFormation::lon, DUNE::IMC::VehicleFormation::speed, DUNE::IMC::VehicleFormation::speed_units, DUNE::Coordinates::toPolar(), DUNE::Maneuvers::VehicleFormation::TPoint::x, DUNE::Maneuvers::VehicleFormation::TPoint::y, DUNE::Maneuvers::VehicleFormation::Participant::z, and DUNE::IMC::VehicleFormation::z.
void DUNE::Maneuvers::VehicleFormation::consume | ( | const IMC::RemoteState * | msg | ) |
Consumer for IMC::RemoteState message.
msg | message |
References DUNE::IMC::Message::getSource().
void DUNE::Maneuvers::VehicleFormation::consume | ( | const IMC::EstimatedState * | msg | ) |
Consumer for IMC::EstimatedState message.
msg | message |
References DUNE::IMC::Message::getTimeStamp(), DUNE::IMC::EstimatedState::lat, and DUNE::IMC::EstimatedState::lon.
|
inline |
Get control step period.
void DUNE::Maneuvers::VehicleFormation::desiredSpeed | ( | double | value, |
uint8_t | speed_units | ||
) |
|
inline |
Get index of local vehicle in formation.
|
inline |
Get index of given IMC address in formation.
|
inline |
Check if maneuver is still in approach stage (i.e.
moving to the initial point).
|
inlinevirtual |
Method invoked on maneuver startup.
By default the base class implementation does nothing.
msg | vehicle formation message |
void DUNE::Maneuvers::VehicleFormation::onManeuverDeactivation | ( | void | ) |
Method called upon maneuver deactivation.
|
pure virtual |
Abstract method called upon path completion.
This will not be called in approach stage (see isApproaching()).
void DUNE::Maneuvers::VehicleFormation::onPathControlState | ( | const IMC::PathControlState * | pcs | ) |
Inherited from Maneuver class.
pcs | path control state message |
References DUNE::IMC::PathControlState::FL_NEAR, and DUNE::IMC::PathControlState::flags.
|
inlinevirtual |
Method invoked on maneuver reset.
By default the base class implementation does nothing.
|
pure virtual |
Abstract method invoked upon a remote state update.
index | formation index of remote vehicle |
rstate | state of remote vehicle |
|
virtual |
|
inline |
Get configuration of a vehicle in formation.
index | formation index |
|
inline |
Get 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.
t_index | index of point |
f_index | formation index (vehicle) |
References DUNE::Coordinates::displace(), DUNE::Coordinates::getBearing(), DUNE::Coordinates::toPolar(), DUNE::Maneuvers::VehicleFormation::TPoint::z, and DUNE::Maneuvers::VehicleFormation::Participant::z.
|
inline |
Get configuration of local vehicle in formation.
|
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 | ||
) |
References DUNE::Coordinates::WGS84::displacement().
|
inline |
Get number of points in the trajetory.