Skip to content

Commit

Permalink
Fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah Gleason committed Oct 31, 2017
1 parent dff5023 commit ac456c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public OIArcadeWithDPad(
this.gamepad = gamepad;
this.scaleRotByFwdPoly = scaleRotByFwdPoly;
this.turnInPlaceRotScale = turnInPlaceRotScale;
timeLastCached = 0;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ public UnidirectionalPoseEstimator(@Nullable Double robotDiameter,
lastTime = 0;
}

private static double[] calcEliVector(double left, double right, double deltaTheta, double lastAngle) {
@NotNull
private double[] calcEliVector(double left, double right, double deltaTheta, double lastAngle) {

//If we're going in a straight line
if (deltaTheta == 0) {
Expand All @@ -168,13 +169,14 @@ private static double[] calcEliVector(double left, double right, double deltaThe
} else {
//This next part is too complicated to explain in comments. Read this wiki page instead:
// http://team449.shoutwiki.com/wiki/Pose_Estimation
double vectorAngle = lastAngle + deltaTheta / 2.;
double vectorMagnitude = 2. * ((left + right) / 2.) / deltaTheta * Math.sin(deltaTheta / 2.);
vectorAngle = lastAngle + deltaTheta / 2.;
vectorMagnitude = 2. * ((left + right) / 2.) / deltaTheta * Math.sin(deltaTheta / 2.);
return new double[]{vectorMagnitude * Math.cos(vectorAngle), vectorMagnitude * Math.sin(vectorAngle)};
}
}

private static double[] calcVector(double left, double right, double robotDiameter, double deltaTheta, double lastAngle) {
@NotNull
private double[] calcVector(double left, double right, double robotDiameter, double deltaTheta, double lastAngle) {

//If we're going in a straight line
if (deltaTheta == 0) {
Expand All @@ -183,7 +185,6 @@ private static double[] calcVector(double left, double right, double robotDiamet
} else {
//This next part is too complicated to explain in comments. Read this wiki page instead:
// http://team449.shoutwiki.com/wiki/Pose_Estimation
double r;
if (left - right == 0) {
vectorMagnitude = 2* left / deltaTheta * Math.sin(deltaTheta / 2.);
} else {
Expand Down

0 comments on commit ac456c7

Please sign in to comment.