Controlor for Humanoid. Walking trajectory generator, sensor reflection etc.
Dependencies: Adafruit-PWM-Servo-Driver MPU6050 RS300 mbed
Controlor.h@23:0927e605af4b, 2013-11-22 (annotated)
- Committer:
- syundo0730
- Date:
- Fri Nov 22 00:30:42 2013 +0000
- Revision:
- 23:0927e605af4b
- Parent:
- 22:bf5aa20b9df0
first commit
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 | 23:0927e605af4b | 6 | #include <fstream> |
syundo0730 | 17:60de3bfdc70b | 7 | |
syundo0730 | 12:6cd135bf03bd | 8 | #include "Motion.h" |
syundo0730 | 20:abb7852df747 | 9 | #include "OfflineMotion.h" |
syundo0730 | 17:60de3bfdc70b | 10 | #include "OnlineMotion.h" |
syundo0730 | 23:0927e605af4b | 11 | #include "CPG.h" |
syundo0730 | 17:60de3bfdc70b | 12 | |
syundo0730 | 22:bf5aa20b9df0 | 13 | #include "Console.h" |
syundo0730 | 21:a54bcab078ed | 14 | //#include "PWM.h" |
syundo0730 | 21:a54bcab078ed | 15 | #include "Adafruit_PWMServoDriver.h" |
syundo0730 | 23:0927e605af4b | 16 | #include "RS300.h" |
syundo0730 | 17:60de3bfdc70b | 17 | |
syundo0730 | 17:60de3bfdc70b | 18 | #include "CSV.h" |
syundo0730 | 19:c2ec475367aa | 19 | #include "readMotion.h" |
syundo0730 | 12:6cd135bf03bd | 20 | |
syundo0730 | 20:abb7852df747 | 21 | class Controlor |
syundo0730 | 12:6cd135bf03bd | 22 | { |
syundo0730 | 12:6cd135bf03bd | 23 | public: |
syundo0730 | 20:abb7852df747 | 24 | Controlor(uint16_t* data); |
syundo0730 | 20:abb7852df747 | 25 | ~Controlor(); |
syundo0730 | 12:6cd135bf03bd | 26 | |
syundo0730 | 12:6cd135bf03bd | 27 | public: |
syundo0730 | 12:6cd135bf03bd | 28 | void control(); |
syundo0730 | 12:6cd135bf03bd | 29 | |
syundo0730 | 12:6cd135bf03bd | 30 | private: |
syundo0730 | 23:0927e605af4b | 31 | void home(); |
syundo0730 | 12:6cd135bf03bd | 32 | void read(const string& filename, uint16_t* data); |
syundo0730 | 12:6cd135bf03bd | 33 | void set(uint16_t* data); |
syundo0730 | 13:711f74b2fa33 | 34 | bool checkid(int id); |
syundo0730 | 13:711f74b2fa33 | 35 | |
syundo0730 | 13:711f74b2fa33 | 36 | public: |
syundo0730 | 13:711f74b2fa33 | 37 | void setmotion(const int id); |
syundo0730 | 12:6cd135bf03bd | 38 | void play(); |
syundo0730 | 12:6cd135bf03bd | 39 | |
syundo0730 | 12:6cd135bf03bd | 40 | private: |
syundo0730 | 12:6cd135bf03bd | 41 | uint16_t*** motions; |
syundo0730 | 12:6cd135bf03bd | 42 | int motion_size; |
syundo0730 | 12:6cd135bf03bd | 43 | int* pose_size; |
syundo0730 | 12:6cd135bf03bd | 44 | int servo_size; |
syundo0730 | 12:6cd135bf03bd | 45 | |
syundo0730 | 20:abb7852df747 | 46 | OfflineMotion* offline; |
syundo0730 | 17:60de3bfdc70b | 47 | OnlineMotion* online; |
syundo0730 | 23:0927e605af4b | 48 | CPG* cpg; |
syundo0730 | 20:abb7852df747 | 49 | Motion* motion; |
syundo0730 | 23:0927e605af4b | 50 | //std::ofstream log; |
syundo0730 | 23:0927e605af4b | 51 | int mode; |
syundo0730 | 17:60de3bfdc70b | 52 | |
syundo0730 | 12:6cd135bf03bd | 53 | private: |
syundo0730 | 12:6cd135bf03bd | 54 | bool playing; |
syundo0730 | 20:abb7852df747 | 55 | bool attached; |
syundo0730 | 22:bf5aa20b9df0 | 56 | Console* comu; |
syundo0730 | 21:a54bcab078ed | 57 | //PWM* pwm; |
syundo0730 | 21:a54bcab078ed | 58 | Adafruit_PWMServoDriver* pwm; |
syundo0730 | 23:0927e605af4b | 59 | RS300* rs300; |
syundo0730 | 12:6cd135bf03bd | 60 | }; |
syundo0730 | 12:6cd135bf03bd | 61 | |
syundo0730 | 23:0927e605af4b | 62 | #endif |