diff options
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; - } -} |