DUNE: Uniform Navigational Environment  2.3.0
Maneuver::VehicleFormation::SMC::Task Struct Reference

Public Member Functions

 Task (const std::string &name, DUNE::Tasks::Context &ctx)
 
void onUpdateParameters (void)
 
void onReset (void)
 
void onInit (const IMC::VehicleFormation *maneuver)
 
void onUpdate (int f_index, const IMC::RemoteState &rstate)
 
void step (const IMC::EstimatedState &estate)
 
void onPathCompletion (void)
 
Matrix findXY (IMC::EstimatedState a, IMC::EstimatedState b, double t)
 
double toActuation (double desired_mps, double max_mps, double max_act, double min_mps, double min_act)
 
- Public Member Functions inherited from DUNE::IMC::VehicleFormation
 VehicleFormation (void)
 
Messageclone (void) const
 
void clear (void)
 
bool fieldsEqual (const Message &msg__) const
 
int validate (void) const
 
uint8_t * serializeFields (uint8_t *bfr__) const
 
uint16_t deserializeFields (const uint8_t *bfr__, uint16_t size__)
 
uint16_t reverseDeserializeFields (const uint8_t *bfr__, uint16_t size__)
 
uint16_t getId (void) const
 
const char * getName (void) const
 
unsigned getFixedSerializationSize (void) const
 
unsigned getVariableSerializationSize (void) const
 
void fieldsToJSON (std::ostream &os__, unsigned nindent__) const
 
- Public Member Functions inherited from DUNE::IMC::Message
 Message (void)
 
virtual ~Message (void)
 
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
 
void toJSON (std::ostream &os) const
 
void toText (std::ostream &os) const
 
bool operator== (const Message &other) const
 
bool operator!= (const Message &other) const
 

Public Attributes

IMC::EstimatedState m_estate
 
double m_zero_time
 
int m_curr
 
double m_last_actuation
 
Matrix m_delta
 
TPoint m_prev
 
Utils::CircularBuffer
< IMC::EstimatedState > 
m_queue
 
Matrix m_errf
 
std::ofstream m_dbg
 
std::ofstream m_dbg_owa
 
std::ofstream m_dbg_owb
 
std::ofstream m_dbg_pw
 
std::ofstream m_dbg_pa_ts
 
std::ofstream m_dbg_pb_ts
 
std::ofstream m_dbg_deltas
 
std::ofstream m_dbg_ferror
 
std::ofstream m_dbg_pa
 
double m_debug_time
 
Arguments m_args
 
- Public Attributes inherited from DUNE::IMC::VehicleFormation
fp64_t lat
 
fp64_t lon
 
fp32_t z
 
uint8_t z_units
 
fp32_t speed
 
uint8_t speed_units
 
MessageList< TrajectoryPointpoints
 
MessageList
< VehicleFormationParticipant
participants
 
fp64_t start_time
 
std::string custom
 

Static Public Attributes

static const int c_queue_size
 

Additional Inherited Members

- Static Public Member Functions inherited from DUNE::IMC::VehicleFormation
static uint16_t getIdStatic (void)
 
- Protected Member Functions inherited from DUNE::IMC::VehicleFormation
void setTimeStampNested (double value__)
 
void setSourceNested (uint16_t value__)
 
void setSourceEntityNested (uint8_t value__)
 
void setDestinationNested (uint16_t value__)
 
void setDestinationEntityNested (uint8_t value__)
 
- Protected Attributes inherited from DUNE::IMC::Message
Header m_header
 

Constructor & Destructor Documentation

Member Function Documentation

Matrix Maneuver::VehicleFormation::SMC::Task::findXY ( IMC::EstimatedState  a,
IMC::EstimatedState  b,
double  t 
)
inline

Function for finding values of x and y through linear interpolation.

References DUNE::Math::linearInterpolation().

Referenced by onUpdate().

void Maneuver::VehicleFormation::SMC::Task::onReset ( void  )
inline
void Maneuver::VehicleFormation::SMC::Task::onUpdateParameters ( void  )
inline
void Maneuver::VehicleFormation::SMC::Task::step ( const IMC::EstimatedState &  estate)
inline
double Maneuver::VehicleFormation::SMC::Task::toActuation ( double  desired_mps,
double  max_mps,
double  max_act,
double  min_mps,
double  min_act 
)
inline

Function to convert meters per second to actuation using a linearized relation between the two.

Member Data Documentation

const int Maneuver::VehicleFormation::SMC::Task::c_queue_size
static

Circular Buffer fixed size.

Arguments Maneuver::VehicleFormation::SMC::Task::m_args

Task arguments.

Referenced by onInit(), onPathCompletion(), onReset(), onUpdate(), and Task().

int Maneuver::VehicleFormation::SMC::Task::m_curr

Number of current waypoint number.

Referenced by onInit(), onPathCompletion(), and onUpdate().

std::ofstream Maneuver::VehicleFormation::SMC::Task::m_dbg

Debug variables and text files generic debug output file.

Referenced by onInit(), onPathCompletion(), onReset(), and onUpdate().

std::ofstream Maneuver::VehicleFormation::SMC::Task::m_dbg_deltas

deltas produced using remote states

Referenced by onInit(), onPathCompletion(), and onReset().

std::ofstream Maneuver::VehicleFormation::SMC::Task::m_dbg_ferror

formation errors yielded using interpolation

Referenced by onInit(), onPathCompletion(), and onReset().

std::ofstream Maneuver::VehicleFormation::SMC::Task::m_dbg_owa

original waypoints in trajectory for vehicle A (present vehicle)

Referenced by onInit(), and onReset().

std::ofstream Maneuver::VehicleFormation::SMC::Task::m_dbg_owb

original waypoints in trajectory for vehicle B (neighbor vehicle)

Referenced by onInit(), and onReset().

std::ofstream Maneuver::VehicleFormation::SMC::Task::m_dbg_pa

present vehicle's position at onPathCompletion time

Referenced by onInit(), onPathCompletion(), and onReset().

std::ofstream Maneuver::VehicleFormation::SMC::Task::m_dbg_pa_ts

position of the present vehicle at remote timestamp

Referenced by onInit(), onReset(), and onUpdate().

std::ofstream Maneuver::VehicleFormation::SMC::Task::m_dbg_pb_ts

position of the neighbor vehicle at remote timestamp

Referenced by onInit(), onReset(), and onUpdate().

std::ofstream Maneuver::VehicleFormation::SMC::Task::m_dbg_pw

produced waypoints (and sent to vehicle) using delta gaps

Referenced by onInit(), onPathCompletion(), and onReset().

double Maneuver::VehicleFormation::SMC::Task::m_debug_time

Time at which the debug data was saved.

Referenced by onInit(), onReset(), and onUpdate().

Matrix Maneuver::VehicleFormation::SMC::Task::m_delta

Trajectory's bias computed by the controller.

Referenced by onInit(), onPathCompletion(), and onUpdate().

Matrix Maneuver::VehicleFormation::SMC::Task::m_errf

Formation error.

Referenced by onInit(), onPathCompletion(), and onUpdate().

IMC::EstimatedState Maneuver::VehicleFormation::SMC::Task::m_estate

last state update

Referenced by onPathCompletion(), onUpdate(), and step().

double Maneuver::VehicleFormation::SMC::Task::m_last_actuation

Last actuation value sent to bus.

Referenced by onInit(), and onPathCompletion().

TPoint Maneuver::VehicleFormation::SMC::Task::m_prev

Previously assigned waypoint.

Referenced by onInit(), and onPathCompletion().

Utils::CircularBuffer<IMC::EstimatedState> Maneuver::VehicleFormation::SMC::Task::m_queue

Circular buffer used to save last few estimated states every second.

Referenced by onReset(), onUpdate(), and step().

double Maneuver::VehicleFormation::SMC::Task::m_zero_time

Starting time reference.

Referenced by onPathCompletion().

Collaboration diagram for Maneuver::VehicleFormation::SMC::Task:
Collaboration graph