1
Dependencies: CircularBuffer Radio Servo Terminal mbed
Fork of WalkingRobot by
Diff: RobotLeg.h
- Revision:
- 5:475f67175510
- Parent:
- 3:6fa07ceb897f
- Child:
- 6:0163f2737cc6
--- a/RobotLeg.h Wed Nov 14 04:29:55 2012 +0000 +++ b/RobotLeg.h Sun Jan 13 02:59:48 2013 +0000 @@ -13,29 +13,34 @@ RobotLeg(PinName thetaPin, PinName phiPin, PinName psiPin); void setDimensions(float a, float b, float c, float d); void setAngleOffsets(float oth, float oph, float ops); + void setStepCircle(float xc, float yc, float zc, float rc); vector3 getPosition(); bool move(vector3 dest); void step(vector3 dest); - void update(const matrix4& deltaTransform); + void reset(float f); + bool update(const matrix4& deltaTransform); Servo theta, phi, psi; - float thetaAngle, phiAngle, psiAngle; protected: + float thetaAngle, phiAngle, psiAngle; + float circleRadius; float a, b, c, d; float oth, oph, ops; float stepDelta, stepPeriod, stepHeight; + vector3 circleCenter; vector3 position; + vector3 nDeltaPosition; vector3 stepA; vector3 stepB; - enum LegState + enum state_t { neutral, stepping }; - LegState state; + state_t state; Timer stepTimer;