Skip to content

Commit

Permalink
Merge branch 'getatomic-lib' of https://github.com/mcm001/photonvision
Browse files Browse the repository at this point in the history
…into getatomic-lib
  • Loading branch information
mcm001 committed May 5, 2024
2 parents 05d6119 + a22eabe commit ecef349
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 1 addition & 0 deletions networktables.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
4 changes: 0 additions & 4 deletions photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,13 @@ PhotonPipelineResult PhotonCamera::GetLatestResult() {
// Create the new result;
PhotonPipelineResult result;

fmt::println("Getting queue for cam {}", rawBytesEntry.GetTopic().GetName());

// Fill the packet with latest data and populate result.
const auto changes = rawBytesEntry.ReadQueue();
if (!changes.size()) {
fmt::println("No new changes");
return result;
}
const nt::Timestamped<std::vector<uint8_t>> value = changes[0];
if (!value.value.size() || value.time == 0) {
fmt::println("empty or time is 0");
return result;
}

Expand Down
5 changes: 1 addition & 4 deletions photon-lib/src/test/native/cpp/VisionSystemSimTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,8 @@ TEST_P(VisionSystemSimTestWithParamsTest, YawAngles) {
visionSysSim.Update(robotPose);

const auto result = camera.GetLatestResult();
fmt::println("Got result at time {} with {} targets", result.GetTimestamp(),
result.GetTargets().size());
fmt::println("pitch {}", result.GetTargets()[0].GetPitch());
ASSERT_TRUE(result.HasTargets());
ASSERT_NEAR(GetParam().to<double>(), result.GetBestTarget().GetPitch(), 0.25);
ASSERT_NEAR(GetParam().to<double>(), result.GetBestTarget().GetYaw(), 0.25);
}

TEST_P(VisionSystemSimTestWithParamsTest, PitchAngles) {
Expand Down

0 comments on commit ecef349

Please sign in to comment.