Controlor for Humanoid. Walking trajectory generator, sensor reflection etc.
Dependencies: Adafruit-PWM-Servo-Driver MPU6050 RS300 mbed
Diff: Motions.cpp
- Revision:
- 14:522bb06f0f0d
- Parent:
- 13:711f74b2fa33
- Child:
- 15:e37a8c413e51
--- a/Motions.cpp Sun Feb 03 21:22:21 2013 +0000 +++ b/Motions.cpp Thu Feb 21 14:27:19 2013 +0000 @@ -85,18 +85,29 @@ if (!playing) { //serial.printf("start motion! id = %d \r\n", id); inter = new Motion(motions[id], pose_size[id], servo_size); - tick.attach(inter, &Motion::step, 0.02); + tick.attach(inter, &Motion::step, TIMESTEP); playing = true; } } +/*void Motions::setmotion(const int id) +{ + //if (inter == NULL) { + //serial.printf("start motion! id = %d \r\n", id); + inter = new Motion(motions[id], pose_size[id], servo_size); + tick.attach(inter, &Motion::step, TIMESTEP); + playing = true; + //} +}*/ + void Motions::control() { play(); - int id = comu->getid(); + //int id = comu->getid(); //serial.printf("id: %d \r\n", id); - if (checkid(id)) { //<- Misterious bug. Why is id starts from 48? - setmotion(id); - } + //if (checkid(id)) { //<- Misterious bug. Why is id starts from 48? + //setmotion(id); + setmotion(0); + //} } \ No newline at end of file