Skip to content

Commit

Permalink
formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
spacey-sooty committed Mar 2, 2024
1 parent 8452473 commit cb1b958
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
35 changes: 18 additions & 17 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 "Shooter.h"
#include "utils/Util.h"

Expand Down Expand Up @@ -67,55 +68,55 @@ VisionShooterSpeed::VisionShooterSpeed(Shooter* shooter, Vision* vision)
units::meter_t VisionShooterSpeed::DistanceFromTarget() {
auto distance = m_vision->GetDistanceToTag();
auto tag = m_vision->GetID();
switch(tag) {
switch (tag) {
case 1:
return wom::utils::Pythagoras(distance, magicvalue);
break;
break;
case 2:
return wom::utils::Pythagoras(distance, magicvalue);
break;
break;
case 3:
return wom::utils::Pythagoras(distance, magicvalue);
break;
break;
case 4:
return wom::utils::Pythagoras(distance, magicvalue);
break;
break;
case 5:
return wom::utils::Pythagoras(distance, magicvalue);
break;
break;
case 6:
return wom::utils::Pythagoras(distance, magicvalue);
break;
break;
case 7:
return wom::utils::Pythagoras(distance, magicvalue);
break;
break;
case 8:
return wom::utils::Pythagoras(distance, magicvalue);
break;
break;
case 9:
return wom::utils::Pythagoras(distance, magicvalue);
break;
break;
case 10:
return wom::utils::Pythagoras(distance, magicvalue);
break;
break;
case 11:
return wom::utils::Pythagoras(distance, magicvalue);
break;
break;
case 12:
return wom::utils::Pythagoras(distance, magicvalue);
break;
break;
case 13:
return wom::utils::Pythagoras(distance, magicvalue);
break;
break;
case 14:
return wom::utils::Pythagoras(distance, magicvalue);
break;
break;
case 15:
return wom::utils::Pythagoras(distance, magicvalue);
break;
break;
case 16:
return wom::utils::Pythagoras(distance, magicvalue);
break;
break;
}
}

Expand Down
1 change: 0 additions & 1 deletion src/main/include/ShooterBehaviour.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <frc/XboxController.h>
#include <networktables/NetworkTable.h>

#include <units/angular_velocity.h>
#include <units/length.h>

Expand Down
2 changes: 1 addition & 1 deletion wombat/src/main/include/utils/Util.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ frc::Pose2d TrajectoryStateToPose2d(frc::Trajectory::State state);
double deadzone(double val, double deadzone = 0.05);
double spow2(double val);

template<typename T>
template <typename T>
T Pythagoras(T a, T b) {
return (a ^ 2 + b ^ 2) ^ 0.5;
}
Expand Down

0 comments on commit cb1b958

Please sign in to comment.