Add Basic Sim Example (#237)

* WIP adding sim pose example

* WIP making examples buildable like WPI. Not quite there yet....

* Make examples runnable

* remove lock

* add lock

* WIP Adding a simpler example for simulation

* Spotless Apply

* Added simulation-supporting aim and range example

* Spotless, revised hand usage to be consistent across examples, and propagated required -1.0's to non-sim examples.

Co-authored-by: Prateek Machiraju <prateek.machiraju@gmail.com>
This commit is contained in:
Chris Gerth
2021-01-26 22:26:15 -06:00
committed by GitHub
parent 4c15a46cda
commit 0330467874
19 changed files with 708 additions and 29 deletions

View File

@@ -84,14 +84,15 @@ public class Robot extends TimedRobot {
result.getBestTarget().getPitch());
// Use this range as the measurement we give to the PID controller.
forwardSpeed = controller.calculate(range, GOAL_RANGE_METERS);
// -1.0 required to ensure positive PID controller effort _increases_ range
forwardSpeed = -1.0 * controller.calculate(range, GOAL_RANGE_METERS);
} else {
// If we have no targets, stay still.
forwardSpeed = 0;
}
} else {
// Manual Driver Mode
forwardSpeed = xboxController.getY(GenericHID.Hand.kRight);
forwardSpeed = -1.0 * xboxController.getY(GenericHID.Hand.kRight);
}
// Use our forward/turn speeds to control the drivetrain