Controlor for Humanoid. Walking trajectory generator, sensor reflection etc.
Dependencies: Adafruit-PWM-Servo-Driver MPU6050 RS300 mbed
Controlor.h@20:abb7852df747, 2013-08-19 (annotated)
- Committer:
- syundo0730
- Date:
- Mon Aug 19 08:10:58 2013 +0000
- Revision:
- 20:abb7852df747
- Parent:
- Motions.h@19:c2ec475367aa
- Child:
- 21:a54bcab078ed
delete Motion instance from Control class
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
syundo0730 | 20:abb7852df747 | 1 | #ifndef CONTROLOR_H_2013_02_02_ |
syundo0730 | 20:abb7852df747 | 2 | #define CONTROLOR_H_2013_02_02_ |
syundo0730 | 12:6cd135bf03bd | 3 | |
syundo0730 | 12:6cd135bf03bd | 4 | #include "mbed.h" |
syundo0730 | 17:60de3bfdc70b | 5 | #include <string> |
syundo0730 | 17:60de3bfdc70b | 6 | |
syundo0730 | 12:6cd135bf03bd | 7 | #include "Motion.h" |
syundo0730 | 20:abb7852df747 | 8 | #include "OfflineMotion.h" |
syundo0730 | 17:60de3bfdc70b | 9 | #include "OnlineMotion.h" |
syundo0730 | 17:60de3bfdc70b | 10 | |
syundo0730 | 12:6cd135bf03bd | 11 | #include "SCI.h" |
syundo0730 | 16:e65c192b7ecf | 12 | #include "PWM.h" |
syundo0730 | 17:60de3bfdc70b | 13 | |
syundo0730 | 17:60de3bfdc70b | 14 | #include "CSV.h" |
syundo0730 | 19:c2ec475367aa | 15 | #include "readMotion.h" |
syundo0730 | 12:6cd135bf03bd | 16 | |
syundo0730 | 14:522bb06f0f0d | 17 | const float TIMESTEP = 0.02; |
syundo0730 | 14:522bb06f0f0d | 18 | |
syundo0730 | 20:abb7852df747 | 19 | class Controlor |
syundo0730 | 12:6cd135bf03bd | 20 | { |
syundo0730 | 12:6cd135bf03bd | 21 | public: |
syundo0730 | 20:abb7852df747 | 22 | Controlor(uint16_t* data); |
syundo0730 | 20:abb7852df747 | 23 | ~Controlor(); |
syundo0730 | 12:6cd135bf03bd | 24 | |
syundo0730 | 12:6cd135bf03bd | 25 | public: |
syundo0730 | 12:6cd135bf03bd | 26 | void control(); |
syundo0730 | 12:6cd135bf03bd | 27 | |
syundo0730 | 12:6cd135bf03bd | 28 | private: |
syundo0730 | 12:6cd135bf03bd | 29 | void read(const string& filename, uint16_t* data); |
syundo0730 | 12:6cd135bf03bd | 30 | void set(uint16_t* data); |
syundo0730 | 13:711f74b2fa33 | 31 | bool checkid(int id); |
syundo0730 | 13:711f74b2fa33 | 32 | |
syundo0730 | 13:711f74b2fa33 | 33 | public: |
syundo0730 | 13:711f74b2fa33 | 34 | void setmotion(const int id); |
syundo0730 | 12:6cd135bf03bd | 35 | void play(); |
syundo0730 | 12:6cd135bf03bd | 36 | |
syundo0730 | 12:6cd135bf03bd | 37 | private: |
syundo0730 | 12:6cd135bf03bd | 38 | uint16_t*** motions; |
syundo0730 | 12:6cd135bf03bd | 39 | int motion_size; |
syundo0730 | 12:6cd135bf03bd | 40 | int* pose_size; |
syundo0730 | 12:6cd135bf03bd | 41 | int servo_size; |
syundo0730 | 12:6cd135bf03bd | 42 | |
syundo0730 | 20:abb7852df747 | 43 | OfflineMotion* offline; |
syundo0730 | 17:60de3bfdc70b | 44 | OnlineMotion* online; |
syundo0730 | 20:abb7852df747 | 45 | Motion* motion; |
syundo0730 | 17:60de3bfdc70b | 46 | |
syundo0730 | 12:6cd135bf03bd | 47 | private: |
syundo0730 | 12:6cd135bf03bd | 48 | bool playing; |
syundo0730 | 20:abb7852df747 | 49 | bool attached; |
syundo0730 | 12:6cd135bf03bd | 50 | SCI* comu; |
syundo0730 | 16:e65c192b7ecf | 51 | PWM* pwm; |
syundo0730 | 12:6cd135bf03bd | 52 | }; |
syundo0730 | 12:6cd135bf03bd | 53 | |
syundo0730 | 12:6cd135bf03bd | 54 | #endif |