#pragma once #include "../common/comm.h" #include "../common/notifier.h" class CMessageQueue; class SocketCan; struct ImuData { /* FVector3 AngVel; // 3 floats, angular velocity vector FVector3 Rotation; FVector3 Accel; */ float rx; float ry; // float rz; }; class CImuSensor { public: CImuSensor(CMessageQueue* q); void Start(); void Stop(); void Notify(int8_t * buffer,int32_t size); void PreProcess(); void SetSensorSocket(SensorSocket* can); private: void ImuProcess(const cannet_frame& frame); int32_t bcd2dec(const int8_t *data); private: CMessageQueue * _message; ImuData _imu; SensorSocket* _can; };