Skip to content

Commit

Permalink
sussy baka
Browse files Browse the repository at this point in the history
  • Loading branch information
spacey-sooty committed Mar 3, 2024
1 parent cb1b958 commit cedd611
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 35 deletions.
26 changes: 1 addition & 25 deletions src/main/cpp/Robot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

#include "RobotMap.h"
#include "behaviour/HasBehaviour.h"
#include "networktables/NetworkTableInstance.h"

static units::second_t lastPeriodic;

Expand Down Expand Up @@ -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() {}
21 changes: 11 additions & 10 deletions src/main/cpp/ShooterBehaviour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// of the MIT License at the root of this project

#include "ShooterBehaviour.h"
#include <stdexcept>

#include "Shooter.h"
#include "utils/Util.h"
Expand Down Expand Up @@ -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);
Expand All @@ -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;
}
}
Expand Down

0 comments on commit cedd611

Please sign in to comment.