diff --git a/src/main/cpp/Robot.cpp b/src/main/cpp/Robot.cpp index af9d93d2..d4ffb799 100644 --- a/src/main/cpp/Robot.cpp +++ b/src/main/cpp/Robot.cpp @@ -19,7 +19,6 @@ #include "RobotMap.h" #include "behaviour/HasBehaviour.h" -#include "networktables/NetworkTableInstance.h" static units::second_t lastPeriodic; @@ -175,28 +174,5 @@ void Robot::DisabledPeriodic() {} void Robot::TestInit() {} void Robot::TestPeriodic() {} -void Robot::SimulationInit() { - /* std::string x = "["; - std::string y = "["; - // _vision->GetDistanceToTarget(16); - for (int i = 1; i < 17; i++) { - for (int j = 0; j < 17; j++) { - frc::Pose2d pose = _vision->AlignToTarget(i, units::meter_t{j * 0.1}, _swerveDrive); - x += std::to_string(pose.X().value()) + ","; - y += std::to_string(pose.Y().value()) + ","; - } - } - - x += "]"; - y += "]"; - - std::cout << x << std::endl; - std::cout << y << std::endl; */ - // std::cout << _vision->TurnToTarget(1, _swerveDrive).Rotation().Degrees().value() << std::endl; - // Reimplement when vision is reimplemented - // frc::Pose2d pose = _vision->TurnToTarget(2, _swerveDrive); - // nt::NetworkTableInstance::GetDefault().GetTable("vision")->PutNumber("rot", - // pose.Rotation().Degrees().value()); -} - +void Robot::SimulationInit() {} void Robot::SimulationPeriodic() {} diff --git a/src/main/cpp/ShooterBehaviour.cpp b/src/main/cpp/ShooterBehaviour.cpp index e9f28def..bd46af7a 100644 --- a/src/main/cpp/ShooterBehaviour.cpp +++ b/src/main/cpp/ShooterBehaviour.cpp @@ -3,6 +3,7 @@ // of the MIT License at the root of this project #include "ShooterBehaviour.h" +#include #include "Shooter.h" #include "utils/Util.h" @@ -70,10 +71,10 @@ units::meter_t VisionShooterSpeed::DistanceFromTarget() { auto tag = m_vision->GetID(); switch (tag) { case 1: - return wom::utils::Pythagoras(distance, magicvalue); + throw new std::runtime_error("UNSUPPORTED TAG"); break; case 2: - return wom::utils::Pythagoras(distance, magicvalue); + throw new std::runtime_error("UNSUPPORTED TAG"); break; case 3: return wom::utils::Pythagoras(distance, magicvalue); @@ -94,28 +95,28 @@ units::meter_t VisionShooterSpeed::DistanceFromTarget() { return wom::utils::Pythagoras(distance, magicvalue); break; case 9: - return wom::utils::Pythagoras(distance, magicvalue); + throw new std::runtime_error("UNSUPPORTED TAG"); break; case 10: - return wom::utils::Pythagoras(distance, magicvalue); + throw new std::runtime_error("UNSUPPORTED TAG"); break; case 11: - return wom::utils::Pythagoras(distance, magicvalue); + throw new std::runtime_error("UNSUPPORTED TAG"); break; case 12: - return wom::utils::Pythagoras(distance, magicvalue); + throw new std::runtime_error("UNSUPPORTED TAG"); break; case 13: - return wom::utils::Pythagoras(distance, magicvalue); + throw new std::runtime_error("UNSUPPORTED TAG"); break; case 14: - return wom::utils::Pythagoras(distance, magicvalue); + throw new std::runtime_error("UNSUPPORTED TAG"); break; case 15: - return wom::utils::Pythagoras(distance, magicvalue); + throw new std::runtime_error("UNSUPPORTED TAG"); break; case 16: - return wom::utils::Pythagoras(distance, magicvalue); + throw new std::runtime_error("UNSUPPORTED TAG"); break; } }