38 lines
515 B
C++
38 lines
515 B
C++
#pragma once
|
|
|
|
#include <freertos/FreeRTOS.h>
|
|
#include <stdint.h>
|
|
#include <MPU.hpp>
|
|
|
|
namespace ugv {
|
|
namespace io {
|
|
|
|
using mpud::float_axes_t;
|
|
|
|
struct MpuData {
|
|
// G's
|
|
float_axes_t accel;
|
|
// degrees/s
|
|
float_axes_t gyro_rate;
|
|
// flux density uT
|
|
float_axes_t mag;
|
|
};
|
|
|
|
class MPU {
|
|
public:
|
|
explicit MPU();
|
|
~MPU();
|
|
|
|
void Init();
|
|
|
|
void GetData(MpuData &data);
|
|
|
|
private:
|
|
mpud::MPU * mpu_;
|
|
mpud::raw_axes_t accel_, gyro_, mag_;
|
|
MpuData mpu_data_;
|
|
};
|
|
|
|
} // namespace io
|
|
} // namespace ugv
|