-
Notifications
You must be signed in to change notification settings - Fork 0
/
ArmAndManipulatorState.java
49 lines (40 loc) · 1.25 KB
/
ArmAndManipulatorState.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package frc.robot.subsystems;
import frc.robot.Constants;
import frc.robot.subsystems.Manipulator.ManipState;
import frc.util.Point;
import frc.util.Util;
public class ArmAndManipulatorState {
public Point position;
public ManipState state;
public double manipAngle;
public ArmAndManipulatorState(Point position, ManipState state, double manipAngle) {
this.position = position;
this.state = state;
this.manipAngle = manipAngle;
}
public Point getPosition() {
return position;
}
public ManipState getState() {
return state;
}
public double getAngle() {
return manipAngle;
}
@Override
public boolean equals(Object obj) {
if(!(obj instanceof ArmAndManipulatorState)) {
return false;
}
ArmAndManipulatorState p = (ArmAndManipulatorState) obj;
boolean equals = true;
equals &= p.position.equals(getPosition());
equals &= Util.withinEpsilon(getAngle(), p.getAngle(), Constants.Units.EPSILON);
equals &= getState() == p.getState();
return equals;
}
@Override
public String toString() {
return "Arm: " + position + " Manip State: " + state + " Manip Angle: " + manipAngle;
}
}