Message Handler Class Reference

class LA_MsgHandler : public MsgHandler

Base class for dataflash message handlers.

Extend this based on the type of the DataFlash message you wish to take data from

Subclassed by LA_MsgHandler_ACC, LA_MsgHandler_AHR2, LA_MsgHandler_ATT, LA_MsgHandler_BARO, LA_MsgHandler_EKF1, LA_MsgHandler_EKF4, LA_MsgHandler_ERR, LA_MsgHandler_EV, LA_MsgHandler_GPA, LA_MsgHandler_GPS, LA_MsgHandler_GYR, LA_MsgHandler_IMU, LA_MsgHandler_MAG, LA_MsgHandler_MODE, LA_MsgHandler_MSG, LA_MsgHandler_NKF1, LA_MsgHandler_NKF4, LA_MsgHandler_ORGN, LA_MsgHandler_PARM, LA_MsgHandler_PM, LA_MsgHandler_POS, LA_MsgHandler_POWR, LA_MsgHandler_RATE, LA_MsgHandler_RCOU, LA_MsgHandler_STAT, LA_MsgHandler_UBX3, LA_MsgHandler_VIBE, LA_MsgHandler_XKF1, LA_MsgHandler_XKF4

Public Functions

inline LA_MsgHandler(std::string name, const struct log_Format &f, Analyze *analyze, AnalyzerVehicle::Base *&vehicle)

construct a DataFlash Message Handler

Note

evaluate_all is called on “analyze” after the vehicle state has been updated

Parameters
  • name – Name by which this message handler is known; e.g. GPS2

  • f – DataFlash log format corresponding to the DataFlash message type

  • analyze – Object which is responsible for coordinating analysis of vehicle state

  • vehicle – a vehicle whose state should be updated by the message handler

inline virtual void process(const uint8_t *msg)

process a DataFlash message, update state, run analysis on new vehicle state

Parameters

msg – a DataFlash message

inline const std::string name() const

return the name of this Message Handler (e.g. GPS2)

Protected Functions

virtual bool find_T(const uint8_t *msg, uint64_t &T)

Try to find a timestamp given a message.

Parameters
  • msg – a dataflash message

  • T[out] a timestamp value to fill in

Returns

true if a timestamp was found

bool process_set_T(const uint8_t *msg)

Try to set vehicle model timestamp from a given message.

Returns

true if timestamp was set

inline uint64_t T() const

return the current vehicle timestamp

virtual void xprocess(const uint8_t *msg) = 0

process a DataFlash message, update vehicle model appropriately

AnalyzerVehicle::AltitudeEstimate *altitude_estimate()

convenience function producing an estimate to be used for state

AnalyzerVehicle::AttitudeEstimate *attitude_estimate()

convenience function producing an estimate to be used for state

AnalyzerVehicle::PositionEstimate *position_estimate()

convenience function producing an estimate to be used for state

AnalyzerVehicle::VelocityEstimate *velocity_estimate()

convenience function producing an estimate to be used for state

AnalyzerVehicle::GPSInfo *gpsinfo()

convenience function producing an estimate to be used for state

AnalyzerVehicle::IMU *imu()

convenience function producing IMU to be used for state

Protected Attributes

std::string _name
Analyze *_analyze
AnalyzerVehicle::Base *&_vehicle

Class to take data from decoded MAVLink messages, update the vehicle model and call the analyzers.

Add methods to this class to handle more MAVLink message types

Public Functions

construct an object to take MAVLink messages, update the vehicle model and call analyzers on the vehicle model

Parameters
  • analyze – object responsible for vehicle analysys

  • vehicle – vehicle to analyze