/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- #ifndef __AP_INERTIAL_SENSOR_PX4_H__ #define __AP_INERTIAL_SENSOR_PX4_H__ #include #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 #include #include "AP_InertialSensor.h" #include #include #include #include class AP_InertialSensor_PX4 : public AP_InertialSensor { public: AP_InertialSensor_PX4() {} /* Concrete implementation of AP_InertialSensor functions: */ bool update(); bool new_data_available(); float temperature(); float get_delta_time(); uint32_t get_last_sample_time_micros(); float get_gyro_drift_rate(); uint16_t num_samples_available(); private: uint16_t _init_sensor( Sample_rate sample_rate ); uint32_t _last_update_usec; float _delta_time; Vector3f _accel_sum; uint32_t _accel_sum_count; Vector3f _gyro_sum; uint32_t _gyro_sum_count; uint8_t _sample_divider; // accelerometer and gyro driver handles int _accel_fd; int _gyro_fd; }; #endif #endif // __AP_INERTIAL_SENSOR_PX4_H__