DUNE: Uniform Navigational Environment
2019.02.1
|
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 TPoint & | point (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 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::FollowTrajectory::FollowTrajectory | ( | const std::string & | name, |
Tasks::Context & | ctx | ||
) |
Constructor.
name | name. |
ctx | context. |
|
virtual |
Destructor.
|
pure virtual |
Method invoked on maneuver startup.
By default the base class implementation does nothing.
msg | maneuver message |
Referenced by consume().
void DUNE::Maneuvers::FollowTrajectory::consume | ( | const IMC::FollowTrajectory * | msg | ) |
Consumer for IMC::FollowTrajectory message.
msg | maneuver message |
References canInit(), DUNE::IMC::CL_PATH, DUNE::IMC::DesiredPath::end_lat, DUNE::IMC::DesiredPath::end_lon, DUNE::IMC::DesiredPath::end_z, DUNE::IMC::DesiredPath::end_z_units, DUNE::IMC::FollowTrajectory::lat, DUNE::IMC::FollowTrajectory::lon, DUNE::IMC::DesiredPath::speed, DUNE::IMC::FollowTrajectory::speed, DUNE::IMC::DesiredPath::speed_units, DUNE::IMC::FollowTrajectory::speed_units, DUNE::IMC::FollowTrajectory::z, and DUNE::IMC::FollowTrajectory::z_units.
void DUNE::Maneuvers::FollowTrajectory::consume | ( | const IMC::EstimatedState * | msg | ) |
Consumer for IMC::EstimatedState message.
msg | message |
References DUNE::IMC::Message::getTimeStamp(), and step().
void DUNE::Maneuvers::FollowTrajectory::consume | ( | const IMC::PathControlState * | pcs | ) |
Consumer for IMC::PathControlState message.
pcs | path control state message |
|
inline |
Get control step period.
Set the desired path.
References DUNE::Coordinates::WGS84::displace(), DUNE::IMC::DesiredPath::end_lat, DUNE::IMC::DesiredPath::end_lon, DUNE::IMC::DesiredPath::end_z, DUNE::IMC::DesiredPath::end_z_units, DUNE::IMC::DesiredPath::FL_START, DUNE::IMC::DesiredPath::flags, DUNE::IMC::DesiredPath::lradius, DUNE::IMC::DesiredPath::start_lat, DUNE::IMC::DesiredPath::start_lon, DUNE::IMC::DesiredPath::start_z, DUNE::IMC::DesiredPath::start_z_units, DUNE::Maneuvers::FollowTrajectory::TPoint::x, DUNE::Maneuvers::FollowTrajectory::TPoint::y, DUNE::Maneuvers::FollowTrajectory::TPoint::z, and DUNE::Maneuvers::FollowTrajectory::TPoint::z_units.
void DUNE::Maneuvers::FollowTrajectory::desiredSpeed | ( | double | value, |
uint8_t | units | ||
) |
Set the desired speed.
References DUNE::IMC::DesiredPath::speed, DUNE::IMC::FollowTrajectory::speed, DUNE::IMC::DesiredSpeed::speed_units, DUNE::IMC::DesiredPath::speed_units, and DUNE::IMC::DesiredSpeed::value.
|
inline |
Check if maneuver is still in approach stage (i.e.
moving to the initial point).
void DUNE::Maneuvers::FollowTrajectory::onManeuverDeactivation | ( | void | ) |
Method called upon maneuver deactivation.
References onReset().
|
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.
pcs | path control state message |
References DUNE::IMC::PathControlState::FL_NEAR, DUNE::IMC::PathControlState::flags, and onPathCompletion().
|
inlinevirtual |
Method invoked on maneuver reset.
By default the base class implementation does nothing.
Referenced by onManeuverDeactivation().
|
virtual |
References DUNE::IMC::MessageList< Type >::begin(), DUNE::IMC::MessageList< Type >::end(), DUNE::IMC::FollowTrajectory::points, DUNE::Maneuvers::FollowTrajectory::TPoint::t, DUNE::Maneuvers::FollowTrajectory::TPoint::x, DUNE::Maneuvers::FollowTrajectory::TPoint::y, DUNE::Maneuvers::FollowTrajectory::TPoint::z, DUNE::IMC::FollowTrajectory::z, DUNE::Maneuvers::FollowTrajectory::TPoint::z_units, and DUNE::IMC::FollowTrajectory::z_units.
|
inline |
Get a point in the trajectory.
t_index | index of point |
|
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().
|
inline |
Get number of points in the trajetory.