mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-24 01:31:44 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user