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