f0757ff184e7603b686780f6990351138f6a1961
2 * Copyright (c) 2015, www.techhounds.com
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
10 * <li>Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.</li>
12 * <li>Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.</li>
15 * <li>Neither the name of the www.techhounds.com nor the
16 * names of its contributors may be used to endorse or promote products
17 * derived from this software without specific prior written permission.</li>
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 package org
.usfirst
.frc
.team3501
.robot
;
36 import edu
.wpi
.first
.wpilibj
.PIDSource
;
39 * A rotation tracker allows you to keep track of how far the robot has rotated
40 * since the object was constructed or zeroed.
43 * This object is most useful when you want to turn your robot a particular
44 * number of degrees, or when you want to detect whether your robot is tipping.
48 * You will typically use the {@link #getRotationTracker} method associated with
49 * the gyro class associated with your hardware. For example
50 * {@link GyroItg3200.getRotationTrackerZ()}.
53 public interface RotationTracker
extends PIDSource
{
56 * Returns the angle in signed decimal degrees since construction or zeroing.
59 * This value is used as the PID sensor value.
62 * @return Number of degrees the robot has rotated in the range of [-INF,
63 * +INF]. Positive values indicate clockwise rotation (720 means it
64 * has spun around twice and is facing the same direction).
66 public double getAngle();
69 * Zeros the rotation tracker so the current direction we are pointing now
70 * becomes the zero point.