teamALI / Mbed 2 deprecated HB2018

Dependencies:   mbed FreeRTOS

Committer:
YutakaTakagi
Date:
Thu Mar 07 10:06:34 2019 +0000
Revision:
58:fb7876549148
Parent:
25:f3a6e7eec9c3
Child:
73:0720e5550476
add yaw rate limit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
takeru0x1103 18:5aa48aec9cae 1 #ifndef __IMU_H__
takeru0x1103 18:5aa48aec9cae 2 #define __IMU_H__
takeru0x1103 8:1ca49cb18290 3
takeru0x1103 9:557628b373ea 4 #include <iostream>
takeru0x1103 9:557628b373ea 5 #include <vector>
takeru0x1103 9:557628b373ea 6 #include <string>
takeru0x1103 9:557628b373ea 7 #include <sstream>
takeru0x1103 9:557628b373ea 8 using namespace std;
MasashiNomura 14:76a56d517103 9 #include "mbed.h"
takeru0x1103 9:557628b373ea 10 #include "typedef.h"
takeru0x1103 9:557628b373ea 11
takeru0x1103 19:4b0fe9a5ec38 12 const float cGYRO_RESO=131.0;
takeru0x1103 19:4b0fe9a5ec38 13
takeru0x1103 19:4b0fe9a5ec38 14
takeru0x1103 19:4b0fe9a5ec38 15 class Imu {
takeru0x1103 17:f9610f3cfa1b 16 private:
takeru0x1103 18:5aa48aec9cae 17 Serial sp46Axis; //
takeru0x1103 16:05b9e44889f1 18 INT16 gyroZ;
takeru0x1103 18:5aa48aec9cae 19 INT16 gyro_ref;
takeru0x1103 9:557628b373ea 20 float yaw;
takeru0x1103 9:557628b373ea 21 float yaw_ref;
takeru0x1103 18:5aa48aec9cae 22 float yawOfset;
YutakaTakagi 58:fb7876549148 23 float yawRateLimit;
takeru0x1103 18:5aa48aec9cae 24
takeru0x1103 17:f9610f3cfa1b 25 //
takeru0x1103 9:557628b373ea 26 void PushBuf(UCHAR rxChar);
takeru0x1103 9:557628b373ea 27 void uartRxIntHndler46Axis();
takeru0x1103 18:5aa48aec9cae 28 float wrapAroungGuard(float iYaw);
YutakaTakagi 58:fb7876549148 29 float limitYawRate(float yawDiff);
takeru0x1103 9:557628b373ea 30 public:
takeru0x1103 18:5aa48aec9cae 31 Imu(PinName pinTx, PinName pinRx);
takeru0x1103 18:5aa48aec9cae 32 virtual ~Imu();
takeru0x1103 18:5aa48aec9cae 33 float GetGyroZ();
takeru0x1103 18:5aa48aec9cae 34 float GetYaw();
MasashiNomura 25:f3a6e7eec9c3 35 float GetYawRef();
MasashiNomura 25:f3a6e7eec9c3 36 INT16 GetGyroRef();
takeru0x1103 18:5aa48aec9cae 37 void CalYaw();
takeru0x1103 18:5aa48aec9cae 38 void CalGyro();
takeru0x1103 8:1ca49cb18290 39 };
takeru0x1103 8:1ca49cb18290 40
takeru0x1103 17:f9610f3cfa1b 41 #endif
takeru0x1103 8:1ca49cb18290 42
takeru0x1103 8:1ca49cb18290 43