Skip to content

Commit

Permalink
Formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
srimanachanta committed Nov 17, 2023
1 parent 2726a3d commit df5a7f0
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@

using namespace photon;

photon::MultiTargetPNPResult::MultiTargetPNPResult(PNPResult result, wpi::SmallVector<int16_t, 32> fiducialIdsUsed) : result(result), fiducialIdsUsed(fiducialIdsUsed) {}
photon::MultiTargetPNPResult::MultiTargetPNPResult(
PNPResult result, wpi::SmallVector<int16_t, 32> fiducialIdsUsed)
: result(result), fiducialIdsUsed(fiducialIdsUsed) {}

bool MultiTargetPNPResult::operator==(const MultiTargetPNPResult& other)
const {
bool MultiTargetPNPResult::operator==(const MultiTargetPNPResult& other) const {
return other.result == result && other.fiducialIdsUsed == fiducialIdsUsed;
}
24 changes: 12 additions & 12 deletions photon-targeting/src/main/native/cpp/photon/targeting/PNPResult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
using namespace photon;

PNPResult::PNPResult(frc::Transform3d best, double bestReprojErr,
frc::Transform3d alt, double altReprojErr,
double ambiguity) : best(best), bestReprojErr(bestReprojErr), alt(alt), altReprojErr(altReprojErr), ambiguity(ambiguity) {
this->isPresent = true;
}


frc::Transform3d alt, double altReprojErr,
double ambiguity)
: best(best),
bestReprojErr(bestReprojErr),
alt(alt),
altReprojErr(altReprojErr),
ambiguity(ambiguity) {
this->isPresent = true;
}

bool PNPResult::operator==(const PNPResult& other) const {
return other.isPresent == isPresent
&& other.best == best
&& other.altReprojErr == bestReprojErr
&& other.alt == alt
&& other.altReprojErr == altReprojErr
&& other.ambiguity == ambiguity;
return other.isPresent == isPresent && other.best == best &&
other.altReprojErr == bestReprojErr && other.alt == alt &&
other.altReprojErr == altReprojErr && other.ambiguity == ambiguity;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

#include "photon/targeting/PhotonPipelineResult.h"

#include "photon/targeting/PNPResult.h"

using namespace photon;
Expand All @@ -27,9 +28,12 @@ PhotonPipelineResult::PhotonPipelineResult(

PhotonPipelineResult::PhotonPipelineResult(
units::second_t latency, std::span<const PhotonTrackedTarget> targets,
MultiTargetPNPResult multitagResult) : latency(latency), targets(targets.data(), targets.data() + targets.size()), multitagResult(multitagResult) {}
MultiTargetPNPResult multitagResult)
: latency(latency),
targets(targets.data(), targets.data() + targets.size()),
multitagResult(multitagResult) {}

bool PhotonPipelineResult::operator==(
const PhotonPipelineResult& other) const {
return latency == other.latency && targets == other.targets && multitagResult == other.multitagResult;
bool PhotonPipelineResult::operator==(const PhotonPipelineResult& other) const {
return latency == other.latency && targets == other.targets &&
multitagResult == other.multitagResult;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
*/

#include "photon/targeting/PhotonTrackedTarget.h"
#include "photon/targeting/TargetCorner.h"

#include <iostream>
#include <utility>

#include <frc/geometry/Translation2d.h>
#include <wpi/SmallVector.h>

#include "photon/targeting/TargetCorner.h"

static constexpr const uint8_t MAX_CORNERS = 8;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class MultiTargetPNPResult {
public:
MultiTargetPNPResult() = default;


MultiTargetPNPResult(PNPResult result,
wpi::SmallVector<int16_t, 32> fiducialIdsUsed);

Expand Down

0 comments on commit df5a7f0

Please sign in to comment.