diff options
author | Peter Wu <lekensteyn@gmail.com> | 2014-01-16 16:45:49 +0100 |
---|---|---|
committer | Peter Wu <lekensteyn@gmail.com> | 2014-01-16 16:45:49 +0100 |
commit | 0706dc0787674ca6bca926e986113aafecfba333 (patch) | |
tree | 6a5e820a401d44ec3e0b8d682b4e66bbe11ae075 /src/DumbWalkAnimation.java | |
parent | 69a2fb7e6db3eef5766b7617b637ee6383fe6d79 (diff) | |
download | 2iv60-robots-0706dc0787674ca6bca926e986113aafecfba333.tar.gz |
Better document SmarterWalkAnimation, remove DumbWalkAnimation
The arm rotation angles are now based on the feet position. Better
explain rationale instead of writing the implementation in comments.
Diffstat (limited to 'src/DumbWalkAnimation.java')
-rw-r--r-- | src/DumbWalkAnimation.java | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/src/DumbWalkAnimation.java b/src/DumbWalkAnimation.java deleted file mode 100644 index 5dc2ac1..0000000 --- a/src/DumbWalkAnimation.java +++ /dev/null @@ -1,65 +0,0 @@ - -/** - * A WalkAnimation that does not result in a smooth transition. The formula and - * constants are chosen at random. - * - * @author Peter Wu - */ -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; - } - - private double getTime() { - return robot_pos_meters / 5; - } - - @Override - public double getLegAngleLeft() { - return Math.sin(-getTime()) * 30.0; - } - - @Override - public double getLegAngleRight() { - return -getLegAngleLeft(); - } - - @Override - public double getKneeAngleLeft() { - return 75.0 + Math.abs(Math.cos(getTime()) * 90.0); - } - - @Override - public double getKneeAngleRight() { - return getKneeAngleLeft(); - } - - @Override - public double getArmAngleLeft() { - // static non-moving arms. - return 0; - } - - @Override - public double getArmAngleRight() { - // static non-moving arms. - return 0; - } - - @Override - public double getBottomOffset() { - return legLength; - } -} |