2013-01-04 01:10:51 -04:00
|
|
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
2016-02-17 21:25:20 -04:00
|
|
|
#pragma once
|
2013-01-04 01:10:51 -04:00
|
|
|
|
2016-03-10 20:41:18 -04:00
|
|
|
#include "AP_Compass.h"
|
2014-11-15 21:58:23 -04:00
|
|
|
#include "AP_Compass_Backend.h"
|
2013-01-04 01:10:51 -04:00
|
|
|
|
2014-11-15 21:58:23 -04:00
|
|
|
class AP_Compass_PX4 : public AP_Compass_Backend
|
2013-01-04 01:10:51 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool init(void);
|
2015-02-23 19:17:44 -04:00
|
|
|
void read(void);
|
2013-01-04 01:10:51 -04:00
|
|
|
void accumulate(void);
|
|
|
|
|
2014-11-15 21:58:23 -04:00
|
|
|
AP_Compass_PX4(Compass &compass);
|
|
|
|
// detect the sensor
|
|
|
|
static AP_Compass_Backend *detect(Compass &compass);
|
|
|
|
|
2013-01-04 01:10:51 -04:00
|
|
|
private:
|
2015-02-23 19:17:44 -04:00
|
|
|
uint8_t _num_sensors;
|
2016-03-10 20:13:31 -04:00
|
|
|
|
2015-02-23 19:17:44 -04:00
|
|
|
uint8_t _instance[COMPASS_MAX_INSTANCES];
|
2014-11-15 21:58:23 -04:00
|
|
|
int _mag_fd[COMPASS_MAX_INSTANCES];
|
2013-12-09 01:05:57 -04:00
|
|
|
Vector3f _sum[COMPASS_MAX_INSTANCES];
|
|
|
|
uint32_t _count[COMPASS_MAX_INSTANCES];
|
|
|
|
uint64_t _last_timestamp[COMPASS_MAX_INSTANCES];
|
2013-01-04 01:10:51 -04:00
|
|
|
};
|