You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
759 B
31 lines
759 B
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- |
|
|
|
#ifndef AP_Compass_PX4_H |
|
#define AP_Compass_PX4_H |
|
|
|
#include "Compass.h" |
|
#include "AP_Compass_Backend.h" |
|
|
|
class AP_Compass_PX4 : public AP_Compass_Backend |
|
{ |
|
public: |
|
bool init(void); |
|
void read(void); |
|
void accumulate(void); |
|
|
|
AP_Compass_PX4(Compass &compass); |
|
// detect the sensor |
|
static AP_Compass_Backend *detect(Compass &compass); |
|
|
|
private: |
|
uint8_t _num_sensors; |
|
|
|
uint8_t _instance[COMPASS_MAX_INSTANCES]; |
|
int _mag_fd[COMPASS_MAX_INSTANCES]; |
|
Vector3f _sum[COMPASS_MAX_INSTANCES]; |
|
uint32_t _count[COMPASS_MAX_INSTANCES]; |
|
uint64_t _last_timestamp[COMPASS_MAX_INSTANCES]; |
|
}; |
|
|
|
#endif // AP_Compass_PX4_H |
|
|
|
|