mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-23 01:21:40 +00:00
Add protobuf publish setting slider (#1075)
Allows logging software and live data view to see results. Also removes the requirement for AScope to keep up with the packet serde schema and instead just use the Protobuf descriptor.
This commit is contained in:
@@ -19,12 +19,12 @@
|
||||
|
||||
namespace photon {
|
||||
PhotonPipelineResult::PhotonPipelineResult(
|
||||
units::second_t latency, std::span<const PhotonTrackedTarget> targets)
|
||||
units::millisecond_t latency, std::span<const PhotonTrackedTarget> targets)
|
||||
: latency(latency),
|
||||
targets(targets.data(), targets.data() + targets.size()) {}
|
||||
|
||||
PhotonPipelineResult::PhotonPipelineResult(
|
||||
units::second_t latency, std::span<const PhotonTrackedTarget> targets,
|
||||
units::millisecond_t latency, std::span<const PhotonTrackedTarget> targets,
|
||||
MultiTargetPNPResult multitagResult)
|
||||
: latency(latency),
|
||||
targets(targets.data(), targets.data() + targets.size()),
|
||||
@@ -37,7 +37,7 @@ bool PhotonPipelineResult::operator==(const PhotonPipelineResult& other) const {
|
||||
|
||||
Packet& operator<<(Packet& packet, const PhotonPipelineResult& result) {
|
||||
// Encode latency and number of targets.
|
||||
packet << result.latency.value() * 1000 << result.multitagResult
|
||||
packet << result.latency.value() << result.multitagResult
|
||||
<< static_cast<int8_t>(result.targets.size());
|
||||
|
||||
// Encode the information of each target.
|
||||
@@ -52,7 +52,7 @@ Packet& operator>>(Packet& packet, PhotonPipelineResult& result) {
|
||||
double latencyMillis = 0;
|
||||
int8_t targetCount = 0;
|
||||
packet >> latencyMillis >> result.multitagResult >> targetCount;
|
||||
result.latency = units::second_t(latencyMillis / 1000.0);
|
||||
result.latency = units::millisecond_t(latencyMillis);
|
||||
|
||||
result.targets.clear();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user