Minor corrections

This commit is contained in:
2023-01-21 21:14:13 -06:00
parent 977a90eb48
commit d70f1e87a1
3 changed files with 8 additions and 8 deletions

View File

@@ -62,7 +62,7 @@ public class Robot {
this.fieldLocalizer.standardSetup(); this.fieldLocalizer.standardSetup();
radius = tuningConfig("field_localizer_robot_radius").value(); radius = tuningConfig("field_localizer_robot_radius").value();
diameter = ((double)tuningConfig("field_localizer_robot_radius").value()) * 2; diameter = radius * 2;
imuAngleOffset = hardwareConfig("imu_angle_offset").value(); imuAngleOffset = hardwareConfig("imu_angle_offset").value();

View File

@@ -22,7 +22,7 @@ public class FieldLocalizer extends CyberarmState {
private final double twoSqrtTwo = 2.0 / Math.sqrt(2.0); private final double twoSqrtTwo = 2.0 / Math.sqrt(2.0);
private double wheelDisplacementPerEncoderTick = 1; // FIXME private double wheelDisplacementPerEncoderTickInInches = 1; // FIXME
// Use this constructor to preserve displacement between opmodes // Use this constructor to preserve displacement between opmodes
public FieldLocalizer() { public FieldLocalizer() {
@@ -63,7 +63,7 @@ public class FieldLocalizer extends CyberarmState {
deltaXRotation = 0; deltaXRotation = 0;
deltaYRotation = 0; deltaYRotation = 0;
// Preserve field position, of argument-less construction is used // Preserve field position, if argument-less constructor is used
lastX = FieldLocalizer.posX; lastX = FieldLocalizer.posX;
lastY = FieldLocalizer.posY; lastY = FieldLocalizer.posY;
@@ -106,10 +106,10 @@ public class FieldLocalizer extends CyberarmState {
deltaBackLeft = robot.backLeftDrive.getCurrentPosition() - lastBackLeft; deltaBackLeft = robot.backLeftDrive.getCurrentPosition() - lastBackLeft;
deltaBackRight = robot.backRightDrive.getCurrentPosition() - lastBackRight; deltaBackRight = robot.backRightDrive.getCurrentPosition() - lastBackRight;
displacementFrontLeft = deltaFrontLeft * wheelDisplacementPerEncoderTick; displacementFrontLeft = deltaFrontLeft * wheelDisplacementPerEncoderTickInInches;
displacementFrontRight = deltaFrontRight * wheelDisplacementPerEncoderTick; displacementFrontRight = deltaFrontRight * wheelDisplacementPerEncoderTickInInches;
displacementBackLeft = deltaBackLeft * wheelDisplacementPerEncoderTick; displacementBackLeft = deltaBackLeft * wheelDisplacementPerEncoderTickInInches;
displacementBackRight = deltaBackRight * wheelDisplacementPerEncoderTick; displacementBackRight = deltaBackRight * wheelDisplacementPerEncoderTickInInches;
displacementAverage = (displacementFrontLeft + displacementFrontRight + displacementAverage = (displacementFrontLeft + displacementFrontRight +
displacementBackLeft + displacementBackRight) / 4.0; // motor count displacementBackLeft + displacementBackRight) / 4.0; // motor count

View File

@@ -15,7 +15,7 @@ public class Field {
} }
private void populateField() { private void populateField() {
// ORIGIN is field CENTER point with RED alliance on the RIGHT // ORIGIN is field CENTER point with RED alliance on the RIGHT (i.e. Audience overhead perspective)
// Ground Junctions // Ground Junctions
double posX = -48; double posX = -48;