Controlor for Humanoid. Walking trajectory generator, sensor reflection etc.
Dependencies: Adafruit-PWM-Servo-Driver MPU6050 RS300 mbed
Motion/OnlineMotion.h@20:abb7852df747, 2013-08-19 (annotated)
- Committer:
- syundo0730
- Date:
- Mon Aug 19 08:10:58 2013 +0000
- Revision:
- 20:abb7852df747
- Parent:
- OnlineMotion.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 | 17:60de3bfdc70b | 1 | #ifndef ONLINEMOTION_H_2013_02_04_ |
syundo0730 | 17:60de3bfdc70b | 2 | #define ONLINEMOTION_H_2013_02_04_ |
syundo0730 | 17:60de3bfdc70b | 3 | |
syundo0730 | 18:7077bedc37eb | 4 | #include <cmath> |
syundo0730 | 18:7077bedc37eb | 5 | |
syundo0730 | 17:60de3bfdc70b | 6 | #include "LPC17xx.h" |
syundo0730 | 17:60de3bfdc70b | 7 | #include "mbed.h" |
syundo0730 | 17:60de3bfdc70b | 8 | #include "PWM.h" |
syundo0730 | 20:abb7852df747 | 9 | //#include "Motion.h" |
syundo0730 | 17:60de3bfdc70b | 10 | |
syundo0730 | 17:60de3bfdc70b | 11 | const float RADTOVAL = (SRV_MAX_DUTY - SRV_MIN_DUTY) / 3.14159265; |
syundo0730 | 17:60de3bfdc70b | 12 | |
syundo0730 | 17:60de3bfdc70b | 13 | const float M_PI = 3.14159265; |
syundo0730 | 17:60de3bfdc70b | 14 | |
syundo0730 | 20:abb7852df747 | 15 | class OnlineMotion //: public Motion |
syundo0730 | 17:60de3bfdc70b | 16 | { |
syundo0730 | 17:60de3bfdc70b | 17 | public: |
syundo0730 | 17:60de3bfdc70b | 18 | OnlineMotion(float _T, float _TIMESTEP, unsigned char _size_num, PWM* _pwm, bool* _playing); |
syundo0730 | 17:60de3bfdc70b | 19 | ~OnlineMotion(); |
syundo0730 | 17:60de3bfdc70b | 20 | public: |
syundo0730 | 17:60de3bfdc70b | 21 | void step(); |
syundo0730 | 17:60de3bfdc70b | 22 | private: |
syundo0730 | 17:60de3bfdc70b | 23 | void update(); |
syundo0730 | 17:60de3bfdc70b | 24 | void play_online(); |
syundo0730 | 17:60de3bfdc70b | 25 | void invertkinematics(float* pos, uint16_t* theta); |
syundo0730 | 17:60de3bfdc70b | 26 | void walk(float* lpos, float* rpos, float h, float stride, float side, float up); |
syundo0730 | 17:60de3bfdc70b | 27 | |
syundo0730 | 17:60de3bfdc70b | 28 | private: |
syundo0730 | 17:60de3bfdc70b | 29 | PWM* pwm; |
syundo0730 | 17:60de3bfdc70b | 30 | unsigned char m_NUM_MAX; |
syundo0730 | 17:60de3bfdc70b | 31 | bool* playing; |
syundo0730 | 19:c2ec475367aa | 32 | volatile float t; |
syundo0730 | 19:c2ec475367aa | 33 | float T ,STEP; |
syundo0730 | 17:60de3bfdc70b | 34 | }; |
syundo0730 | 17:60de3bfdc70b | 35 | |
syundo0730 | 17:60de3bfdc70b | 36 | #endif |