![](/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
Diff: Motions.cpp
- Revision:
- 18:7077bedc37eb
- Parent:
- 17:60de3bfdc70b
- Child:
- 19:c2ec475367aa
diff -r 60de3bfdc70b -r 7077bedc37eb Motions.cpp --- a/Motions.cpp Tue Apr 02 04:19:09 2013 +0000 +++ b/Motions.cpp Wed Apr 03 04:56:13 2013 +0000 @@ -7,7 +7,7 @@ //detach may be better to controled from Motions class -Motions::Motions(uint16_t* data) +Motions::Motions(uint16_t* data) : playing(false) { pwm = new PWM(); //comu = new SCI(p28, p27); @@ -19,8 +19,6 @@ read("/local/motion.csv", data); set(data); - playing = false; - // Motion 0 is Home position setmotion(0); } @@ -74,10 +72,10 @@ void Motions::setmotion(const int id) { if (!playing) { - offline = new Motion(motions[id], pose_size[id], servo_size, pwm, &playing); - tick.attach(offline, &Motion::step, TIMESTEP); - //online = new OnlineMotion(1.0, TIMESTEP, servo_size, pwm, &playing); - //tick.attach(online, &OnlineMotion::step, TIMESTEP); + //offline = new Motion(motions[id], pose_size[id], servo_size, pwm, &playing); + //tick.attach(offline, &Motion::step, TIMESTEP); + online = new OnlineMotion(1.0, TIMESTEP, servo_size, pwm, &playing); + tick.attach(online, &OnlineMotion::step, TIMESTEP); } }