2016-02-17 21:26:01 -04:00
|
|
|
#pragma once
|
2015-06-14 04:17:42 -03:00
|
|
|
|
2015-06-29 02:59:53 -03:00
|
|
|
#include "MsgHandler.h"
|
2015-06-14 04:17:42 -03:00
|
|
|
|
2015-10-26 03:37:16 -03:00
|
|
|
#include <functional>
|
|
|
|
|
2015-06-14 04:17:42 -03:00
|
|
|
class LR_MsgHandler : public MsgHandler {
|
|
|
|
public:
|
|
|
|
LR_MsgHandler(struct log_Format &f,
|
2019-03-27 18:44:23 -03:00
|
|
|
AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &last_timestamp_usec);
|
|
|
|
virtual void process_message(uint8_t *msg) = 0;
|
|
|
|
|
2015-06-26 02:12:17 -03:00
|
|
|
// state for CHEK message
|
|
|
|
struct CheckState {
|
|
|
|
uint64_t time_us;
|
|
|
|
Vector3f euler;
|
|
|
|
Location pos;
|
|
|
|
Vector3f velocity;
|
|
|
|
};
|
|
|
|
|
2015-06-14 04:17:42 -03:00
|
|
|
protected:
|
2019-03-27 18:44:23 -03:00
|
|
|
AP_Logger &logger;
|
2015-06-14 04:17:42 -03:00
|
|
|
void wait_timestamp(uint32_t timestamp);
|
|
|
|
void wait_timestamp_usec(uint64_t timestamp);
|
|
|
|
void wait_timestamp_from_msg(uint8_t *msg);
|
|
|
|
|
|
|
|
uint64_t &last_timestamp_usec;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/* subclasses below this point */
|
|
|
|
|
|
|
|
class LR_MsgHandler_AHR2 : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_AHR2(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec, Vector3f &_ahr2_attitude)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler(_f, _logger,_last_timestamp_usec),
|
2015-06-14 04:17:42 -03:00
|
|
|
ahr2_attitude(_ahr2_attitude) { };
|
|
|
|
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Vector3f &ahr2_attitude;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class LR_MsgHandler_ARM : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_ARM(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler(_f, _logger, _last_timestamp_usec) { };
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class LR_MsgHandler_ARSP : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_ARSP(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec, AP_Airspeed &_airspeed) :
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler(_f, _logger, _last_timestamp_usec), airspeed(_airspeed) { };
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
|
|
|
|
private:
|
|
|
|
AP_Airspeed &airspeed;
|
|
|
|
};
|
|
|
|
|
2016-05-05 01:08:52 -03:00
|
|
|
class LR_MsgHandler_NKF1 : public LR_MsgHandler
|
2015-06-14 04:17:42 -03:00
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_NKF1(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec) :
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler(_f, _logger, _last_timestamp_usec) { };
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class LR_MsgHandler_ATT : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_ATT(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec, Vector3f &_attitude)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler(_f, _logger, _last_timestamp_usec), attitude(_attitude)
|
2015-06-14 04:17:42 -03:00
|
|
|
{ };
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Vector3f &attitude;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-06-26 02:12:17 -03:00
|
|
|
class LR_MsgHandler_CHEK : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_CHEK(log_Format &_f, AP_Logger &_logger,
|
2015-06-26 02:12:17 -03:00
|
|
|
uint64_t &_last_timestamp_usec, CheckState &_check_state)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler(_f, _logger, _last_timestamp_usec),
|
2015-06-26 02:12:17 -03:00
|
|
|
check_state(_check_state)
|
|
|
|
{ };
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
|
|
|
|
private:
|
|
|
|
CheckState &check_state;
|
|
|
|
};
|
|
|
|
|
2015-06-14 04:17:42 -03:00
|
|
|
class LR_MsgHandler_BARO : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_BARO(log_Format &_f, AP_Logger &_logger,
|
2018-03-05 16:38:10 -04:00
|
|
|
uint64_t &_last_timestamp_usec)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler(_f, _logger, _last_timestamp_usec)
|
2018-03-05 16:38:10 -04:00
|
|
|
{ };
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class LR_MsgHandler_Event : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_Event(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler(_f, _logger, _last_timestamp_usec) { };
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LR_MsgHandler_GPS_Base : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_GPS_Base(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec, AP_GPS &_gps,
|
2016-05-03 19:26:02 -03:00
|
|
|
uint32_t &_ground_alt_cm)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler(_f, _logger, _last_timestamp_usec),
|
2016-05-03 19:26:02 -03:00
|
|
|
gps(_gps), ground_alt_cm(_ground_alt_cm) { };
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
protected:
|
2016-05-03 19:26:02 -03:00
|
|
|
void update_from_msg_gps(uint8_t imu_offset, uint8_t *data);
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
private:
|
|
|
|
AP_GPS &gps;
|
|
|
|
uint32_t &ground_alt_cm;
|
|
|
|
};
|
|
|
|
|
|
|
|
class LR_MsgHandler_GPS : public LR_MsgHandler_GPS_Base
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_GPS(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec, AP_GPS &_gps,
|
2016-05-03 19:26:02 -03:00
|
|
|
uint32_t &_ground_alt_cm)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler_GPS_Base(_f, _logger,_last_timestamp_usec,
|
2016-05-03 19:26:02 -03:00
|
|
|
_gps, _ground_alt_cm),
|
|
|
|
gps(_gps), ground_alt_cm(_ground_alt_cm) { };
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
void process_message(uint8_t *msg);
|
|
|
|
|
|
|
|
private:
|
|
|
|
AP_GPS &gps;
|
|
|
|
uint32_t &ground_alt_cm;
|
|
|
|
};
|
|
|
|
|
|
|
|
// it would be nice to use the same parser for both GPS message types
|
|
|
|
// (and other packets, too...). I*think* the contructor can simply
|
|
|
|
// take e.g. &gps[1]... problems are going to arise if we don't
|
|
|
|
// actually have that many gps' compiled in!
|
|
|
|
class LR_MsgHandler_GPS2 : public LR_MsgHandler_GPS_Base
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_GPS2(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec, AP_GPS &_gps,
|
2016-05-03 19:26:02 -03:00
|
|
|
uint32_t &_ground_alt_cm)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler_GPS_Base(_f, _logger, _last_timestamp_usec,
|
2016-05-03 19:26:02 -03:00
|
|
|
_gps, _ground_alt_cm), gps(_gps),
|
|
|
|
ground_alt_cm(_ground_alt_cm) { };
|
2015-06-14 04:17:42 -03:00
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
private:
|
|
|
|
AP_GPS &gps;
|
|
|
|
uint32_t &ground_alt_cm;
|
|
|
|
};
|
|
|
|
|
2016-05-04 05:16:25 -03:00
|
|
|
class LR_MsgHandler_GPA_Base : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_GPA_Base(log_Format &_f, AP_Logger &_logger,
|
2016-05-04 05:16:25 -03:00
|
|
|
uint64_t &_last_timestamp_usec, AP_GPS &_gps)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler(_f, _logger, _last_timestamp_usec), gps(_gps) { };
|
2016-05-04 05:16:25 -03:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void update_from_msg_gpa(uint8_t imu_offset, uint8_t *data);
|
|
|
|
|
|
|
|
private:
|
|
|
|
AP_GPS &gps;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class LR_MsgHandler_GPA : public LR_MsgHandler_GPA_Base
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_GPA(log_Format &_f, AP_Logger &_logger,
|
2016-05-04 05:16:25 -03:00
|
|
|
uint64_t &_last_timestamp_usec, AP_GPS &_gps)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler_GPA_Base(_f, _logger,_last_timestamp_usec,
|
2016-05-04 05:16:25 -03:00
|
|
|
_gps), gps(_gps) { };
|
|
|
|
|
|
|
|
void process_message(uint8_t *msg);
|
|
|
|
|
|
|
|
private:
|
|
|
|
AP_GPS &gps;
|
|
|
|
};
|
|
|
|
|
|
|
|
class LR_MsgHandler_GPA2 : public LR_MsgHandler_GPA_Base
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_GPA2(log_Format &_f, AP_Logger &_logger,
|
2016-05-04 05:16:25 -03:00
|
|
|
uint64_t &_last_timestamp_usec, AP_GPS &_gps)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler_GPA_Base(_f, _logger, _last_timestamp_usec,
|
2016-05-04 05:16:25 -03:00
|
|
|
_gps), gps(_gps) { };
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
private:
|
|
|
|
AP_GPS &gps;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
|
|
|
|
class LR_MsgHandler_IMU_Base : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_IMU_Base(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec,
|
|
|
|
uint8_t &_accel_mask, uint8_t &_gyro_mask,
|
|
|
|
AP_InertialSensor &_ins) :
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler(_f, _logger, _last_timestamp_usec),
|
2015-06-14 04:17:42 -03:00
|
|
|
accel_mask(_accel_mask),
|
|
|
|
gyro_mask(_gyro_mask),
|
|
|
|
ins(_ins) { };
|
2015-06-15 05:13:23 -03:00
|
|
|
void update_from_msg_imu(uint8_t imu_offset, uint8_t *msg);
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
private:
|
|
|
|
uint8_t &accel_mask;
|
|
|
|
uint8_t &gyro_mask;
|
|
|
|
AP_InertialSensor &ins;
|
|
|
|
};
|
|
|
|
|
|
|
|
class LR_MsgHandler_IMU : public LR_MsgHandler_IMU_Base
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_IMU(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec,
|
|
|
|
uint8_t &_accel_mask, uint8_t &_gyro_mask,
|
|
|
|
AP_InertialSensor &_ins)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler_IMU_Base(_f, _logger, _last_timestamp_usec,
|
2015-06-14 04:17:42 -03:00
|
|
|
_accel_mask, _gyro_mask, _ins) { };
|
|
|
|
|
|
|
|
void process_message(uint8_t *msg);
|
|
|
|
};
|
|
|
|
|
|
|
|
class LR_MsgHandler_IMU2 : public LR_MsgHandler_IMU_Base
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_IMU2(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec,
|
|
|
|
uint8_t &_accel_mask, uint8_t &_gyro_mask,
|
|
|
|
AP_InertialSensor &_ins)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler_IMU_Base(_f, _logger, _last_timestamp_usec,
|
2015-06-14 04:17:42 -03:00
|
|
|
_accel_mask, _gyro_mask, _ins) {};
|
|
|
|
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
};
|
|
|
|
|
|
|
|
class LR_MsgHandler_IMU3 : public LR_MsgHandler_IMU_Base
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_IMU3(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec,
|
|
|
|
uint8_t &_accel_mask, uint8_t &_gyro_mask,
|
|
|
|
AP_InertialSensor &_ins)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler_IMU_Base(_f, _logger, _last_timestamp_usec,
|
2015-06-14 04:17:42 -03:00
|
|
|
_accel_mask, _gyro_mask, _ins) {};
|
|
|
|
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-06-15 05:13:23 -03:00
|
|
|
class LR_MsgHandler_IMT_Base : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_IMT_Base(log_Format &_f, AP_Logger &_logger,
|
2015-06-16 01:26:07 -03:00
|
|
|
uint64_t &_last_timestamp_usec,
|
|
|
|
uint8_t &_accel_mask, uint8_t &_gyro_mask,
|
|
|
|
bool &_use_imt,
|
|
|
|
AP_InertialSensor &_ins) :
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler(_f, _logger, _last_timestamp_usec),
|
2015-06-15 05:13:23 -03:00
|
|
|
accel_mask(_accel_mask),
|
|
|
|
gyro_mask(_gyro_mask),
|
2015-06-16 01:26:07 -03:00
|
|
|
use_imt(_use_imt),
|
2015-06-15 05:13:23 -03:00
|
|
|
ins(_ins) { };
|
|
|
|
void update_from_msg_imt(uint8_t imu_offset, uint8_t *msg);
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint8_t &accel_mask;
|
|
|
|
uint8_t &gyro_mask;
|
2015-06-16 01:26:07 -03:00
|
|
|
bool &use_imt;
|
2015-06-15 05:13:23 -03:00
|
|
|
AP_InertialSensor &ins;
|
|
|
|
};
|
|
|
|
|
|
|
|
class LR_MsgHandler_IMT : public LR_MsgHandler_IMT_Base
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_IMT(log_Format &_f, AP_Logger &_logger,
|
2015-06-16 01:26:07 -03:00
|
|
|
uint64_t &_last_timestamp_usec,
|
|
|
|
uint8_t &_accel_mask, uint8_t &_gyro_mask,
|
|
|
|
bool &_use_imt,
|
|
|
|
AP_InertialSensor &_ins)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler_IMT_Base(_f, _logger, _last_timestamp_usec,
|
2015-06-16 01:26:07 -03:00
|
|
|
_accel_mask, _gyro_mask, _use_imt, _ins) { };
|
2015-06-15 05:13:23 -03:00
|
|
|
|
|
|
|
void process_message(uint8_t *msg);
|
|
|
|
};
|
|
|
|
|
|
|
|
class LR_MsgHandler_IMT2 : public LR_MsgHandler_IMT_Base
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_IMT2(log_Format &_f, AP_Logger &_logger,
|
2015-06-16 01:26:07 -03:00
|
|
|
uint64_t &_last_timestamp_usec,
|
|
|
|
uint8_t &_accel_mask, uint8_t &_gyro_mask,
|
|
|
|
bool &_use_imt,
|
|
|
|
AP_InertialSensor &_ins)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler_IMT_Base(_f, _logger, _last_timestamp_usec,
|
2015-06-16 01:26:07 -03:00
|
|
|
_accel_mask, _gyro_mask, _use_imt, _ins) { };
|
2015-06-15 05:13:23 -03:00
|
|
|
|
|
|
|
void process_message(uint8_t *msg);
|
|
|
|
};
|
|
|
|
|
|
|
|
class LR_MsgHandler_IMT3 : public LR_MsgHandler_IMT_Base
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_IMT3(log_Format &_f, AP_Logger &_logger,
|
2015-06-16 01:26:07 -03:00
|
|
|
uint64_t &_last_timestamp_usec,
|
|
|
|
uint8_t &_accel_mask, uint8_t &_gyro_mask,
|
|
|
|
bool &_use_imt,
|
|
|
|
AP_InertialSensor &_ins)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler_IMT_Base(_f, _logger, _last_timestamp_usec,
|
2015-06-16 01:26:07 -03:00
|
|
|
_accel_mask, _gyro_mask, _use_imt, _ins) { };
|
2015-06-15 05:13:23 -03:00
|
|
|
|
|
|
|
void process_message(uint8_t *msg);
|
|
|
|
};
|
|
|
|
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
class LR_MsgHandler_MAG_Base : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_MAG_Base(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec, Compass &_compass)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler(_f, _logger, _last_timestamp_usec), compass(_compass) { };
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void update_from_msg_compass(uint8_t compass_offset, uint8_t *msg);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Compass &compass;
|
|
|
|
};
|
|
|
|
|
|
|
|
class LR_MsgHandler_MAG : public LR_MsgHandler_MAG_Base
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_MAG(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec, Compass &_compass)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler_MAG_Base(_f, _logger, _last_timestamp_usec,_compass) {};
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
};
|
|
|
|
|
|
|
|
class LR_MsgHandler_MAG2 : public LR_MsgHandler_MAG_Base
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_MAG2(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec, Compass &_compass)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler_MAG_Base(_f, _logger, _last_timestamp_usec,_compass) {};
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LR_MsgHandler_MSG : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_MSG(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec,
|
|
|
|
VehicleType::vehicle_type &_vehicle, AP_AHRS &_ahrs) :
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler(_f, _logger, _last_timestamp_usec),
|
2015-06-14 04:17:42 -03:00
|
|
|
vehicle(_vehicle), ahrs(_ahrs) { }
|
|
|
|
|
|
|
|
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
|
|
|
|
private:
|
|
|
|
VehicleType::vehicle_type &vehicle;
|
|
|
|
AP_AHRS &ahrs;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class LR_MsgHandler_NTUN_Copter : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_NTUN_Copter(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec, Vector3f &_inavpos)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler(_f, _logger, _last_timestamp_usec), inavpos(_inavpos) {};
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Vector3f &inavpos;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class LR_MsgHandler_PARM : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_PARM(log_Format &_f, AP_Logger &_logger,
|
2015-10-26 03:37:16 -03:00
|
|
|
uint64_t &_last_timestamp_usec,
|
|
|
|
const std::function<bool(const char *name, const float)>&set_parameter_callback) :
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler(_f, _logger, _last_timestamp_usec),
|
2015-10-26 03:37:16 -03:00
|
|
|
_set_parameter_callback(set_parameter_callback)
|
|
|
|
{};
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
virtual void process_message(uint8_t *msg);
|
2015-10-26 03:37:16 -03:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool set_parameter(const char *name, const float value);
|
|
|
|
const std::function<bool(const char *name, const float)>_set_parameter_callback;
|
2015-06-14 04:17:42 -03:00
|
|
|
};
|
|
|
|
|
2016-03-10 18:13:28 -04:00
|
|
|
class LR_MsgHandler_PM : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_PM(log_Format &_f, AP_Logger &_logger,
|
2016-03-10 18:13:28 -04:00
|
|
|
uint64_t &_last_timestamp_usec)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler(_f, _logger, _last_timestamp_usec) { };
|
2016-03-10 18:13:28 -04:00
|
|
|
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
};
|
2015-06-14 04:17:42 -03:00
|
|
|
|
|
|
|
class LR_MsgHandler_SIM : public LR_MsgHandler
|
|
|
|
{
|
|
|
|
public:
|
2019-03-27 18:44:23 -03:00
|
|
|
LR_MsgHandler_SIM(log_Format &_f, AP_Logger &_logger,
|
2015-06-14 04:17:42 -03:00
|
|
|
uint64_t &_last_timestamp_usec,
|
|
|
|
Vector3f &_sim_attitude)
|
2019-03-27 18:44:23 -03:00
|
|
|
: LR_MsgHandler(_f, _logger, _last_timestamp_usec),
|
2015-06-14 04:17:42 -03:00
|
|
|
sim_attitude(_sim_attitude)
|
|
|
|
{ };
|
|
|
|
|
|
|
|
virtual void process_message(uint8_t *msg);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Vector3f &sim_attitude;
|
|
|
|
};
|