Controlor for Humanoid. Walking trajectory generator, sensor reflection etc.
Dependencies: Adafruit-PWM-Servo-Driver MPU6050 RS300 mbed
Motions.h@17:60de3bfdc70b, 2013-04-02 (annotated)
- Committer:
- syundo0730
- Date:
- Tue Apr 02 04:19:09 2013 +0000
- Revision:
- 17:60de3bfdc70b
- Parent:
- 16:e65c192b7ecf
- Child:
- 19:c2ec475367aa
+realtime module(not move well)
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 | 12:6cd135bf03bd | 14 | |
syundo0730 | 14:522bb06f0f0d | 15 | const float TIMESTEP = 0.02; |
syundo0730 | 14:522bb06f0f0d | 16 | |
syundo0730 | 12:6cd135bf03bd | 17 | class Motions |
syundo0730 | 12:6cd135bf03bd | 18 | { |
syundo0730 | 12:6cd135bf03bd | 19 | public: |
syundo0730 | 12:6cd135bf03bd | 20 | Motions(uint16_t* data); |
syundo0730 | 12:6cd135bf03bd | 21 | ~Motions(); |
syundo0730 | 12:6cd135bf03bd | 22 | |
syundo0730 | 12:6cd135bf03bd | 23 | public: |
syundo0730 | 12:6cd135bf03bd | 24 | void control(); |
syundo0730 | 12:6cd135bf03bd | 25 | |
syundo0730 | 12:6cd135bf03bd | 26 | private: |
syundo0730 | 12:6cd135bf03bd | 27 | void read(const string& filename, uint16_t* data); |
syundo0730 | 12:6cd135bf03bd | 28 | void set(uint16_t* data); |
syundo0730 | 13:711f74b2fa33 | 29 | bool checkid(int id); |
syundo0730 | 13:711f74b2fa33 | 30 | |
syundo0730 | 13:711f74b2fa33 | 31 | public: |
syundo0730 | 13:711f74b2fa33 | 32 | void setmotion(const int id); |
syundo0730 | 12:6cd135bf03bd | 33 | void play(); |
syundo0730 | 12:6cd135bf03bd | 34 | |
syundo0730 | 12:6cd135bf03bd | 35 | private: |
syundo0730 | 12:6cd135bf03bd | 36 | uint16_t*** motions; |
syundo0730 | 12:6cd135bf03bd | 37 | int motion_size; |
syundo0730 | 12:6cd135bf03bd | 38 | int* pose_size; |
syundo0730 | 12:6cd135bf03bd | 39 | int servo_size; |
syundo0730 | 12:6cd135bf03bd | 40 | |
syundo0730 | 17:60de3bfdc70b | 41 | Motion* offline; |
syundo0730 | 17:60de3bfdc70b | 42 | OnlineMotion* online; |
syundo0730 | 17:60de3bfdc70b | 43 | |
syundo0730 | 12:6cd135bf03bd | 44 | private: |
syundo0730 | 12:6cd135bf03bd | 45 | bool playing; |
syundo0730 | 12:6cd135bf03bd | 46 | SCI* comu; |
syundo0730 | 16:e65c192b7ecf | 47 | PWM* pwm; |
syundo0730 | 12:6cd135bf03bd | 48 | }; |
syundo0730 | 12:6cd135bf03bd | 49 | |
syundo0730 | 12:6cd135bf03bd | 50 | #endif |