Skip to content
This repository was archived by the owner on Sep 14, 2019. It is now read-only.

Commit 1c73625

Browse files
committed
More updates to AutoMoveTo
1 parent cc0d6d5 commit 1c73625

2 files changed

Lines changed: 6 additions & 23 deletions

File tree

Robot2018/src/org/usfirst/frc/team199/Robot2018/commands/AutoMoveTo.java

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import edu.wpi.first.wpilibj.command.CommandGroup;
1010

1111
/**
12-
*
12+
* The AutoMoveTo command, which makes the robot go through a set of movements and rotations.
1313
*/
1414
public class AutoMoveTo extends CommandGroup {
1515

@@ -29,33 +29,17 @@ public AutoMoveTo(String[] args) {
2929
pointparts = parentheseless.split(",");
3030
point[0] = Double.parseDouble(pointparts[0]);
3131
point[1] = Double.parseDouble(pointparts[1]);
32-
addSequential(new PIDTurn(Math.toDegrees(Math.atan((point[0] - AutoUtils.getX())/(point[1] - AutoUtils.getY())) - AutoUtils.getRot()), Robot.dt, Robot.dt.getGyro()));
33-
addSequential(new PIDMove(Math.sqrt(((point[0] - AutoUtils.getX()) * (point[0] - AutoUtils.getX()) + ((point[1] - AutoUtils.getY()) * (point[1] - AutoUtils.getY())))), Robot.dt, new PIDSourceAverage(null, null)));
32+
addSequential(new PIDTurn(Math.toDegrees(Math.atan((point[0] - AutoUtils.getX())/(point[1] - AutoUtils.getY())) - AutoUtils.getRot()),
33+
Robot.dt, Robot.dt.getGyro()));
34+
addSequential(new PIDMove(Math.sqrt(((point[0] - AutoUtils.getX()) * (point[0] - AutoUtils.getX()) +
35+
((point[1] - AutoUtils.getY()) * (point[1] - AutoUtils.getY())))),
36+
Robot.dt, new PIDSourceAverage(null, null)));
3437
AutoUtils.setX(point[0]);
3538
AutoUtils.setY(point[1]);
3639
AutoUtils.setRot(Math.toDegrees(Math.atan((point[0] - AutoUtils.getX())/(point[1] - AutoUtils.getY()))));
3740
} else {
3841
throw new IllegalArgumentException();
3942
}
4043
}
41-
42-
43-
44-
// Add Commands here:
45-
// e.g. addSequential(new Command1());
46-
// addSequential(new Command2());
47-
// these will run in order.
48-
49-
// To run multiple commands at the same time,
50-
// use addParallel()
51-
// e.g. addParallel(new Command1());
52-
// addSequential(new Command2());
53-
// Command1 and Command2 will run in parallel.
54-
55-
// A command group will require all of the subsystems that each member
56-
// would require.
57-
// e.g. if Command1 requires chassis, and Command2 requires arm,
58-
// a CommandGroup containing them would require both the chassis and the
59-
// arm.
6044
}
6145
}

Robot2018/src/org/usfirst/frc/team199/Robot2018/subsystems/Drivetrain.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ public void shiftGearSolenoidOff() {
233233
dtGear.set(DoubleSolenoid.Value.kOff);
234234
}
235235
/**
236-
* Returns the gyroscope
237236
* @return the gyroscope
238237
*/
239238
public AHRS getGyro() {

0 commit comments

Comments
 (0)