This repository was archived by the owner on Sep 14, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
Robot2018/src/org/usfirst/frc/team199/Robot2018/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,16 +25,17 @@ public RunScript(String scriptName) {
2525 addSequential (new AutoMoveTo (cmdArgs .split (" " )));
2626 break ;
2727 case "turn" :
28- double rotation = Double .parseDouble (cmdArgs );
29- addSequential (new PIDTurn (rotation , Robot .dt , Robot .sd , Robot .dt .getGyro ()));
30- AutoUtils .position .setRot (rotation );
28+ if (AutoUtils .isPoint (cmdArgs )) {
29+ double [] point = AutoUtils .parsePoint (cmdArgs );
30+ addSequential (new PIDTurn (point , Robot .dt , Robot .sd , Robot .dt .getGyro ()));
31+ } else {
32+ double rotation = Double .parseDouble (cmdArgs );
33+ addSequential (new PIDTurn (rotation , Robot .dt , Robot .sd , Robot .dt .getGyro ()));
34+ }
3135 break ;
3236 case "move" :
3337 double distance = Double .parseDouble (cmdArgs );
34-
3538 addSequential (new PIDMove (distance , Robot .dt , Robot .sd , Robot .dt .getDistEncAvg ()));
36- AutoUtils .position .setX (distance * Math .sin (Math .toRadians (AutoUtils .position .getRot ())));
37- AutoUtils .position .setY (distance * Math .cos (Math .toRadians (AutoUtils .position .getRot ())));
3839 break ;
3940 case "switch" :
4041 addSequential (new EjectToSwitch ());
You can’t perform that action at this time.
0 commit comments