diff options
author | Peter Wu <lekensteyn@gmail.com> | 2014-01-13 23:28:57 +0100 |
---|---|---|
committer | Peter Wu <lekensteyn@gmail.com> | 2014-01-15 12:59:57 +0100 |
commit | 84284be382b0a32dff0294e07054a921a87943ac (patch) | |
tree | 41e124240f4a574b6906c666c090fbd81f132a55 /src/DumbWalkAnimation.java | |
parent | 7b76e9085081fe2b9e82b677c263e11efdb08871 (diff) | |
download | 2iv60-robots-84284be382b0a32dff0294e07054a921a87943ac.tar.gz |
Initial working implementation of SmarterWalkAnimation
Diffstat (limited to 'src/DumbWalkAnimation.java')
-rw-r--r-- | src/DumbWalkAnimation.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/DumbWalkAnimation.java b/src/DumbWalkAnimation.java index 7ff44d1..5dc2ac1 100644 --- a/src/DumbWalkAnimation.java +++ b/src/DumbWalkAnimation.java @@ -8,10 +8,16 @@ public class DumbWalkAnimation implements WalkAnimation { private double robot_pos_meters; + private final double legLength; + + DumbWalkAnimation(float legTopLength, float legBottomLength) { + this.legLength = legTopLength + legBottomLength; + } /** * Sets the new position for the robot. */ + @Override public void updatePosition(double pos) { this.robot_pos_meters = pos; } @@ -35,6 +41,7 @@ public class DumbWalkAnimation implements WalkAnimation { return 75.0 + Math.abs(Math.cos(getTime()) * 90.0); } + @Override public double getKneeAngleRight() { return getKneeAngleLeft(); } @@ -50,4 +57,9 @@ public class DumbWalkAnimation implements WalkAnimation { // static non-moving arms. return 0; } + + @Override + public double getBottomOffset() { + return legLength; + } } |