![](/media/cache/profiles/e5815151957be36ad2085b7a1a02c5cc.jpg.50x50_q85.jpg)
Controlor for Humanoid. Walking trajectory generator, sensor reflection etc.
Dependencies: Adafruit-PWM-Servo-Driver MPU6050 RS300 mbed
OnlineMotion.h@17:60de3bfdc70b, 2013-04-02 (annotated)
- Committer:
- syundo0730
- Date:
- Tue Apr 02 04:19:09 2013 +0000
- Revision:
- 17:60de3bfdc70b
- Child:
- 18:7077bedc37eb
+realtime module(not move well)
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 | 17:60de3bfdc70b | 4 | #include "LPC17xx.h" |
syundo0730 | 17:60de3bfdc70b | 5 | #include "mbed.h" |
syundo0730 | 17:60de3bfdc70b | 6 | #include "PWM.h" |
syundo0730 | 17:60de3bfdc70b | 7 | |
syundo0730 | 17:60de3bfdc70b | 8 | const float RADTOVAL = (SRV_MAX_DUTY - SRV_MIN_DUTY) / 3.14159265; |
syundo0730 | 17:60de3bfdc70b | 9 | |
syundo0730 | 17:60de3bfdc70b | 10 | const float M_PI = 3.14159265; |
syundo0730 | 17:60de3bfdc70b | 11 | |
syundo0730 | 17:60de3bfdc70b | 12 | class OnlineMotion |
syundo0730 | 17:60de3bfdc70b | 13 | { |
syundo0730 | 17:60de3bfdc70b | 14 | public: |
syundo0730 | 17:60de3bfdc70b | 15 | OnlineMotion(float _T, float _TIMESTEP, unsigned char _size_num, PWM* _pwm, bool* _playing); |
syundo0730 | 17:60de3bfdc70b | 16 | ~OnlineMotion(); |
syundo0730 | 17:60de3bfdc70b | 17 | public: |
syundo0730 | 17:60de3bfdc70b | 18 | void step(); |
syundo0730 | 17:60de3bfdc70b | 19 | private: |
syundo0730 | 17:60de3bfdc70b | 20 | void update(); |
syundo0730 | 17:60de3bfdc70b | 21 | void play_online(); |
syundo0730 | 17:60de3bfdc70b | 22 | void invertkinematics(float* pos, uint16_t* theta); |
syundo0730 | 17:60de3bfdc70b | 23 | void walk(float* lpos, float* rpos, float h, float stride, float side, float up); |
syundo0730 | 17:60de3bfdc70b | 24 | |
syundo0730 | 17:60de3bfdc70b | 25 | |
syundo0730 | 17:60de3bfdc70b | 26 | private: |
syundo0730 | 17:60de3bfdc70b | 27 | PWM* pwm; |
syundo0730 | 17:60de3bfdc70b | 28 | uint16_t** m_data; |
syundo0730 | 17:60de3bfdc70b | 29 | unsigned short int m_IDX_MAX; |
syundo0730 | 17:60de3bfdc70b | 30 | unsigned char m_NUM_MAX; |
syundo0730 | 17:60de3bfdc70b | 31 | bool* playing; |
syundo0730 | 17:60de3bfdc70b | 32 | float t, T ,STEP; |
syundo0730 | 17:60de3bfdc70b | 33 | }; |
syundo0730 | 17:60de3bfdc70b | 34 | |
syundo0730 | 17:60de3bfdc70b | 35 | #endif |