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@18:5aa48aec9cae, 2018-12-01 (annotated)
- Committer:
- takeru0x1103
- Date:
- Sat Dec 01 14:03:08 2018 +0000
- Revision:
- 18:5aa48aec9cae
- Parent:
- 17:f9610f3cfa1b
- Child:
- 19:4b0fe9a5ec38
??????????PID????????????
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 | 17:f9610f3cfa1b | 19 | ///////////////////////////////////////////////// |
takeru0x1103 | 17:f9610f3cfa1b | 20 | class HbManager{ |
takeru0x1103 | 17:f9610f3cfa1b | 21 | private: |
takeru0x1103 | 18:5aa48aec9cae | 22 | INT16 motorVal[4] ;// |
takeru0x1103 | 18:5aa48aec9cae | 23 | UINT16 accelVal[2] ;// |
takeru0x1103 | 18:5aa48aec9cae | 24 | float nowAngle ;// |
takeru0x1103 | 18:5aa48aec9cae | 25 | float nowRate ;// |
takeru0x1103 | 18:5aa48aec9cae | 26 | |
takeru0x1103 | 18:5aa48aec9cae | 27 | HbEngine *eng[2] ;//エンジン制御クラス |
takeru0x1103 | 18:5aa48aec9cae | 28 | HbAttitude *att ;//姿勢制御クラス |
takeru0x1103 | 18:5aa48aec9cae | 29 | HbMotor *mot[3] ;//モーター制御クラス |
takeru0x1103 | 18:5aa48aec9cae | 30 | Imu *imu ;//慣性計測装置 |
takeru0x1103 | 17:f9610f3cfa1b | 31 | public: |
takeru0x1103 | 17:f9610f3cfa1b | 32 | HbManager(); |
takeru0x1103 | 18:5aa48aec9cae | 33 | void getAttitude(); |
takeru0x1103 | 18:5aa48aec9cae | 34 | void controlAttitude(); |
takeru0x1103 | 18:5aa48aec9cae | 35 | void controlMotor(); |
takeru0x1103 | 18:5aa48aec9cae | 36 | |
takeru0x1103 | 17:f9610f3cfa1b | 37 | void controlEngine(); |
takeru0x1103 | 17:f9610f3cfa1b | 38 | void getUserCommand(); |
takeru0x1103 | 17:f9610f3cfa1b | 39 | }; |
takeru0x1103 | 0:ecd925601fc6 | 40 | |
takeru0x1103 | 0:ecd925601fc6 | 41 | ///////////////////////////////////////////////////////////////////// |
takeru0x1103 | 16:05b9e44889f1 | 42 | #endif |