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.
HbManager.h@19:4b0fe9a5ec38, 2018-12-05 (annotated)
- Committer:
- takeru0x1103
- Date:
- Wed Dec 05 00:12:38 2018 +0000
- Revision:
- 19:4b0fe9a5ec38
- Parent:
- 18:5aa48aec9cae
- Child:
- 21:78302ecdb661
???????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
takeru0x1103 | 16:05b9e44889f1 | 1 | #ifndef __HBMANAGER_H__ |
takeru0x1103 | 16:05b9e44889f1 | 2 | #define __HBMANAGER_H__ |
takeru0x1103 | 0:ecd925601fc6 | 3 | ///////////////////////////////////////////////////////////////////// |
takeru0x1103 | 17:f9610f3cfa1b | 4 | #include "typedef.h" |
takeru0x1103 | 17:f9610f3cfa1b | 5 | #include "HbEngine.h" |
takeru0x1103 | 18:5aa48aec9cae | 6 | #include "HbAttitude.h" |
takeru0x1103 | 18:5aa48aec9cae | 7 | #include "HbMotor.h" |
takeru0x1103 | 18:5aa48aec9cae | 8 | #include "Imu.h" |
takeru0x1103 | 17:f9610f3cfa1b | 9 | |
takeru0x1103 | 17:f9610f3cfa1b | 10 | //ユーザースイッチ(ハンドル)のレジスタ読み値のビットフィールド |
takeru0x1103 | 17:f9610f3cfa1b | 11 | typedef union{ |
takeru0x1103 | 17:f9610f3cfa1b | 12 | UINT16 w; |
takeru0x1103 | 17:f9610f3cfa1b | 13 | struct{ |
takeru0x1103 | 17:f9610f3cfa1b | 14 | UCHAR axl_r : 1; |
takeru0x1103 | 17:f9610f3cfa1b | 15 | UCHAR axl_l : 1; |
takeru0x1103 | 17:f9610f3cfa1b | 16 | }bf; |
takeru0x1103 | 17:f9610f3cfa1b | 17 | }typu_USER_SW; |
takeru0x1103 | 0:ecd925601fc6 | 18 | |
takeru0x1103 | 19:4b0fe9a5ec38 | 19 | |
takeru0x1103 | 19:4b0fe9a5ec38 | 20 | |
takeru0x1103 | 17:f9610f3cfa1b | 21 | ///////////////////////////////////////////////// |
takeru0x1103 | 17:f9610f3cfa1b | 22 | class HbManager{ |
takeru0x1103 | 17:f9610f3cfa1b | 23 | private: |
takeru0x1103 | 18:5aa48aec9cae | 24 | INT16 motorVal[4] ;// |
takeru0x1103 | 18:5aa48aec9cae | 25 | UINT16 accelVal[2] ;// |
takeru0x1103 | 19:4b0fe9a5ec38 | 26 | float nowAngle ;//現在ヨー角 |
takeru0x1103 | 19:4b0fe9a5ec38 | 27 | float nowRate ;//現在加速度 |
takeru0x1103 | 19:4b0fe9a5ec38 | 28 | //メンバクラス |
takeru0x1103 | 18:5aa48aec9cae | 29 | HbEngine *eng[2] ;//エンジン制御クラス |
takeru0x1103 | 18:5aa48aec9cae | 30 | HbAttitude *att ;//姿勢制御クラス |
takeru0x1103 | 19:4b0fe9a5ec38 | 31 | HbMotor *mot[4] ;//モーター制御クラス |
takeru0x1103 | 18:5aa48aec9cae | 32 | Imu *imu ;//慣性計測装置 |
takeru0x1103 | 17:f9610f3cfa1b | 33 | public: |
takeru0x1103 | 17:f9610f3cfa1b | 34 | HbManager(); |
takeru0x1103 | 18:5aa48aec9cae | 35 | void getAttitude(); |
takeru0x1103 | 18:5aa48aec9cae | 36 | void controlAttitude(); |
takeru0x1103 | 18:5aa48aec9cae | 37 | void controlMotor(); |
takeru0x1103 | 18:5aa48aec9cae | 38 | |
takeru0x1103 | 17:f9610f3cfa1b | 39 | void controlEngine(); |
takeru0x1103 | 17:f9610f3cfa1b | 40 | void getUserCommand(); |
takeru0x1103 | 17:f9610f3cfa1b | 41 | }; |
takeru0x1103 | 0:ecd925601fc6 | 42 | |
takeru0x1103 | 0:ecd925601fc6 | 43 | ///////////////////////////////////////////////////////////////////// |
takeru0x1103 | 16:05b9e44889f1 | 44 | #endif |