Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Imu.h@25:f3a6e7eec9c3, 2018-12-12 (annotated)
- Committer:
- MasashiNomura
- Date:
- Wed Dec 12 23:52:22 2018 +0000
- Revision:
- 25:f3a6e7eec9c3
- Parent:
- 19:4b0fe9a5ec38
- Child:
- 58:fb7876549148
2018/12/11
Who changed what in which revision?
User | Revision | Line number | New 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; |
takeru0x1103 | 18:5aa48aec9cae | 23 | |
takeru0x1103 | 17:f9610f3cfa1b | 24 | // |
takeru0x1103 | 9:557628b373ea | 25 | void PushBuf(UCHAR rxChar); |
takeru0x1103 | 9:557628b373ea | 26 | void uartRxIntHndler46Axis(); |
takeru0x1103 | 18:5aa48aec9cae | 27 | float wrapAroungGuard(float iYaw); |
takeru0x1103 | 9:557628b373ea | 28 | public: |
takeru0x1103 | 18:5aa48aec9cae | 29 | Imu(PinName pinTx, PinName pinRx); |
takeru0x1103 | 18:5aa48aec9cae | 30 | virtual ~Imu(); |
takeru0x1103 | 18:5aa48aec9cae | 31 | float GetGyroZ(); |
takeru0x1103 | 18:5aa48aec9cae | 32 | float GetYaw(); |
MasashiNomura | 25:f3a6e7eec9c3 | 33 | float GetYawRef(); |
MasashiNomura | 25:f3a6e7eec9c3 | 34 | INT16 GetGyroRef(); |
takeru0x1103 | 18:5aa48aec9cae | 35 | void CalYaw(); |
takeru0x1103 | 18:5aa48aec9cae | 36 | void CalGyro(); |
takeru0x1103 | 8:1ca49cb18290 | 37 | }; |
takeru0x1103 | 8:1ca49cb18290 | 38 | |
takeru0x1103 | 17:f9610f3cfa1b | 39 | #endif |
takeru0x1103 | 8:1ca49cb18290 | 40 | |
takeru0x1103 | 8:1ca49cb18290 | 41 |