Skip to content

Commit

Permalink
Remove hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed May 29, 2024
1 parent 64fb555 commit 3e39f6f
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions photon-lib/src/test/native/cpp/VisionSystemSimTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
* SOFTWARE.
*/

#include <chrono>
#include <thread>

#include "gtest/gtest.h"
#include "photon/PhotonUtils.h"
#include "photon/simulation/VisionSystemSim.h"
#include <thread>
#include <chrono>

class VisionSystemSimTest : public ::testing::Test {
void SetUp() override {
Expand Down Expand Up @@ -254,10 +255,6 @@ TEST_P(VisionSystemSimTestWithParamsTest, PitchAngles) {
frc::Rotation3d{0_rad, units::degree_t{GetParam()}, 0_rad}});
visionSysSim.Update(robotPose);

// HACK: wait a bit to let udates propogate
nt::NetworkTableInstance::GetDefault().Flush();
std::this_thread::sleep_for(std::chrono::seconds(1));

ASSERT_TRUE(camera.GetLatestResult().HasTargets());
ASSERT_NEAR(GetParam().to<double>(),
camera.GetLatestResult().GetBestTarget().GetPitch(), 0.25);
Expand Down Expand Up @@ -292,10 +289,6 @@ TEST_P(VisionSystemSimTestDistanceParamsTest, DistanceCalc) {
targetPose, photon::TargetModel{0.5_m, 0.5_m}, 0}});
visionSysSim.Update(robotPose);

// HACK: wait a bit to let udates propogate
nt::NetworkTableInstance::GetDefault().Flush();
std::this_thread::sleep_for(std::chrono::seconds(1));

photon::PhotonPipelineResult res = camera.GetLatestResult();
ASSERT_TRUE(res.HasTargets());
photon::PhotonTrackedTarget target = res.GetBestTarget();
Expand Down

0 comments on commit 3e39f6f

Please sign in to comment.