Skip to content

Commit

Permalink
Formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
srimanachanta committed Nov 24, 2023
1 parent 4826b18 commit 7123f30
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
namespace photon {

bool MultiTargetPNPResult::operator==(const MultiTargetPNPResult& other) const {
return other.best == best &&
other.bestReprojErr == bestReprojErr && other.alt == alt &&
other.altReprojErr == altReprojErr && other.ambiguity == ambiguity
&& other.fiducialIdsUsed == fiducialIdsUsed;
return other.best == best && other.bestReprojErr == bestReprojErr &&
other.alt == alt && other.altReprojErr == altReprojErr &&
other.ambiguity == ambiguity &&
other.fiducialIdsUsed == fiducialIdsUsed;
}
} // namespace photon

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ wpi::Protobuf<photon::PhotonPipelineResult>::Unpack(
targets.emplace_back(wpi::UnpackProtobuf<photon::PhotonTrackedTarget>(t));
}

if(m->has_multi_target_result()) {
if (m->has_multi_target_result()) {
return photon::PhotonPipelineResult{
units::millisecond_t{m->latency_ms()}, targets,
wpi::UnpackProtobuf<photon::MultiTargetPNPResult>(m->multi_target_result())};
wpi::UnpackProtobuf<photon::MultiTargetPNPResult>(
m->multi_target_result())};
} else {
return photon::PhotonPipelineResult{units::millisecond_t{m->latency_ms()}, targets};
return photon::PhotonPipelineResult{units::millisecond_t{m->latency_ms()},
targets};
}
}

Expand All @@ -65,7 +67,8 @@ void wpi::Protobuf<photon::PhotonPipelineResult>::Pack(
wpi::PackProtobuf(m->add_targets(), t);
}

if(value.multitagResult.has_value()) {
wpi::PackProtobuf(m->mutable_multi_target_result(), value.multitagResult.value());
if (value.multitagResult.has_value()) {
wpi::PackProtobuf(m->mutable_multi_target_result(),
value.multitagResult.value());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

#pragma once

#include <optional>
#include <span>
#include <string>
#include <optional>

#include <frc/Errors.h>
#include <units/time.h>
Expand Down Expand Up @@ -104,9 +104,12 @@ class PhotonPipelineResult {
units::second_t GetTimestamp() const { return timestamp; }

/**
* Return the MultiTarget Result. Empty if disabled or unable to create result.
* Return the MultiTarget Result. Empty if disabled or unable to create
* result.
*/
std::optional<MultiTargetPNPResult> MultiTagResult() { return multitagResult; }
std::optional<MultiTargetPNPResult> MultiTagResult() {
return multitagResult;
}

/**
* Sets the timestamp in seconds
Expand Down

0 comments on commit 7123f30

Please sign in to comment.