Skip to content

Commit

Permalink
autoshoots
Browse files Browse the repository at this point in the history
  • Loading branch information
RED2 authored and RED2 committed Mar 12, 2024
1 parent 2eb3c0d commit f6918f5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/cpp/AutoAimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,11 @@ void AutoAimer::MonitorLauncherFlyWheelSpeed(RobotControlData& data) {
auto current = data.launcherOutput.flywheelSpeed;
frc::SmartDashboard::PutNumber("FlywheelSpeedSetPoint", setpoint);

frc::SmartDashboard::PutBoolean("VisionFlywheelAtSpeed?????", std::fabs(setpoint - current) < 0.05 * setpoint);
bool atSpeed = std::fabs(setpoint - current) <= 0.1 * std::fabs(setpoint);

if (std::fabs(setpoint) - current < 0.05 * setpoint) {
frc::SmartDashboard::PutBoolean("VisionFlywheelAtSpeed?????", atSpeed);

if (atSpeed) {

m_flyWheelState++;

Expand Down Expand Up @@ -216,7 +218,7 @@ void AutoAimer::HandleInput(RobotControlData& data) {
}
case 1:
{
// TurnRobotToHeading(data);
TurnRobotToHeading(data);
MonitorLauncherAngle(data);
MonitorLauncherFlyWheelSpeed(data);

Expand Down

0 comments on commit f6918f5

Please sign in to comment.