mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-02 02:51:40 +00:00
Bump wpilib to latest dev (#1327)
This commit is contained in:
@@ -18,11 +18,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <bit>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <wpi/Endian.h>
|
||||
|
||||
namespace photon {
|
||||
|
||||
/**
|
||||
@@ -73,8 +72,7 @@ class Packet {
|
||||
packetData.resize(packetData.size() + sizeof(T));
|
||||
std::memcpy(packetData.data() + writePos, &src, sizeof(T));
|
||||
|
||||
if constexpr (wpi::support::endian::system_endianness() ==
|
||||
wpi::support::endianness::little) {
|
||||
if constexpr (std::endian::native == std::endian::little) {
|
||||
// Reverse to big endian for network conventions.
|
||||
std::reverse(packetData.data() + writePos,
|
||||
packetData.data() + writePos + sizeof(T));
|
||||
@@ -95,8 +93,7 @@ class Packet {
|
||||
if (!packetData.empty()) {
|
||||
std::memcpy(&value, packetData.data() + readPos, sizeof(T));
|
||||
|
||||
if constexpr (wpi::support::endian::system_endianness() ==
|
||||
wpi::support::endianness::little) {
|
||||
if constexpr (std::endian::native == std::endian::little) {
|
||||
// Reverse to little endian for host.
|
||||
uint8_t& raw = reinterpret_cast<uint8_t&>(value);
|
||||
std::reverse(&raw, &raw + sizeof(T));
|
||||
|
||||
@@ -160,6 +160,8 @@ class PacketTest {
|
||||
9.0,
|
||||
-5.0,
|
||||
-1,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(),
|
||||
new Transform3d(),
|
||||
-1,
|
||||
@@ -198,6 +200,8 @@ class PacketTest {
|
||||
9.0,
|
||||
4.0,
|
||||
2,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
0.25,
|
||||
@@ -217,6 +221,8 @@ class PacketTest {
|
||||
9.1,
|
||||
6.7,
|
||||
3,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
0.25,
|
||||
@@ -247,6 +253,8 @@ class PacketTest {
|
||||
9.0,
|
||||
4.0,
|
||||
2,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
0.25,
|
||||
@@ -266,6 +274,8 @@ class PacketTest {
|
||||
9.1,
|
||||
6.7,
|
||||
3,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
0.25,
|
||||
@@ -303,6 +313,8 @@ class PacketTest {
|
||||
9.0,
|
||||
4.0,
|
||||
2,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
0.25,
|
||||
@@ -322,6 +334,8 @@ class PacketTest {
|
||||
9.1,
|
||||
6.7,
|
||||
3,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
0.25,
|
||||
|
||||
@@ -45,6 +45,8 @@ public class PhotonPipelineResultTest {
|
||||
9.0,
|
||||
4.0,
|
||||
2,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
0.25,
|
||||
@@ -64,6 +66,8 @@ public class PhotonPipelineResultTest {
|
||||
9.1,
|
||||
6.7,
|
||||
3,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
0.25,
|
||||
@@ -89,6 +93,8 @@ public class PhotonPipelineResultTest {
|
||||
9.0,
|
||||
4.0,
|
||||
2,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
0.25,
|
||||
@@ -108,6 +114,8 @@ public class PhotonPipelineResultTest {
|
||||
9.1,
|
||||
6.7,
|
||||
3,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
0.25,
|
||||
@@ -135,6 +143,8 @@ public class PhotonPipelineResultTest {
|
||||
9.0,
|
||||
4.0,
|
||||
2,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
0.25,
|
||||
@@ -154,6 +164,8 @@ public class PhotonPipelineResultTest {
|
||||
9.1,
|
||||
6.7,
|
||||
3,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
0.25,
|
||||
@@ -183,6 +195,8 @@ public class PhotonPipelineResultTest {
|
||||
9.0,
|
||||
4.0,
|
||||
2,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
0.25,
|
||||
@@ -202,6 +216,8 @@ public class PhotonPipelineResultTest {
|
||||
9.1,
|
||||
6.7,
|
||||
3,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
0.25,
|
||||
@@ -236,6 +252,8 @@ public class PhotonPipelineResultTest {
|
||||
9.0,
|
||||
4.0,
|
||||
2,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
0.25,
|
||||
@@ -255,6 +273,8 @@ public class PhotonPipelineResultTest {
|
||||
1.0,
|
||||
-9.0,
|
||||
3,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
0.25,
|
||||
@@ -280,6 +300,8 @@ public class PhotonPipelineResultTest {
|
||||
1.0,
|
||||
-9.0,
|
||||
2,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
0.25,
|
||||
@@ -299,6 +321,8 @@ public class PhotonPipelineResultTest {
|
||||
9.1,
|
||||
6.7,
|
||||
3,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
0.25,
|
||||
@@ -326,6 +350,8 @@ public class PhotonPipelineResultTest {
|
||||
9.0,
|
||||
4.0,
|
||||
2,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
0.25,
|
||||
@@ -345,6 +371,8 @@ public class PhotonPipelineResultTest {
|
||||
9.1,
|
||||
6.7,
|
||||
3,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
0.25,
|
||||
@@ -374,6 +402,8 @@ public class PhotonPipelineResultTest {
|
||||
9.0,
|
||||
4.0,
|
||||
2,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
0.25,
|
||||
@@ -393,6 +423,8 @@ public class PhotonPipelineResultTest {
|
||||
9.1,
|
||||
6.7,
|
||||
3,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
0.25,
|
||||
|
||||
@@ -36,6 +36,8 @@ public class PhotonTrackedTargetTest {
|
||||
9.0,
|
||||
-5.0,
|
||||
-1,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(), new Rotation3d()),
|
||||
new Transform3d(new Translation3d(), new Rotation3d()),
|
||||
0.25,
|
||||
@@ -56,6 +58,8 @@ public class PhotonTrackedTargetTest {
|
||||
9.0,
|
||||
-5.0,
|
||||
-1,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(), new Rotation3d()),
|
||||
new Transform3d(new Translation3d(), new Rotation3d()),
|
||||
0.25,
|
||||
@@ -81,6 +85,8 @@ public class PhotonTrackedTargetTest {
|
||||
9.0,
|
||||
-5.0,
|
||||
-1,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(), new Rotation3d()),
|
||||
new Transform3d(new Translation3d(), new Rotation3d()),
|
||||
0.25,
|
||||
@@ -101,6 +107,8 @@ public class PhotonTrackedTargetTest {
|
||||
1.0,
|
||||
-9.0,
|
||||
-1,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(), new Rotation3d()),
|
||||
new Transform3d(new Translation3d(), new Rotation3d()),
|
||||
0.25,
|
||||
|
||||
@@ -49,6 +49,8 @@ public class PhotonPipelineResultProtoTest {
|
||||
9.0,
|
||||
4.0,
|
||||
2,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
0.25,
|
||||
@@ -68,6 +70,8 @@ public class PhotonPipelineResultProtoTest {
|
||||
9.1,
|
||||
6.7,
|
||||
3,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
0.25,
|
||||
@@ -99,6 +103,8 @@ public class PhotonPipelineResultProtoTest {
|
||||
9.0,
|
||||
4.0,
|
||||
2,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
new Transform3d(new Translation3d(1, 2, 3), new Rotation3d(1, 2, 3)),
|
||||
0.25,
|
||||
@@ -118,6 +124,8 @@ public class PhotonPipelineResultProtoTest {
|
||||
9.1,
|
||||
6.7,
|
||||
3,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
new Transform3d(new Translation3d(4, 2, 3), new Rotation3d(1, 5, 3)),
|
||||
0.25,
|
||||
|
||||
@@ -39,6 +39,8 @@ public class PhotonTrackedTargetProtoTest {
|
||||
9.0,
|
||||
-5.0,
|
||||
-1,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(), new Rotation3d()),
|
||||
new Transform3d(new Translation3d(), new Rotation3d()),
|
||||
0.25,
|
||||
@@ -75,6 +77,8 @@ public class PhotonTrackedTargetProtoTest {
|
||||
9.0,
|
||||
-5.0,
|
||||
-1,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(), new Rotation3d()),
|
||||
new Transform3d(new Translation3d(), new Rotation3d()),
|
||||
0.25,
|
||||
@@ -94,6 +98,8 @@ public class PhotonTrackedTargetProtoTest {
|
||||
1.0,
|
||||
-9.0,
|
||||
-1,
|
||||
-1,
|
||||
-1f,
|
||||
new Transform3d(new Translation3d(), new Rotation3d()),
|
||||
new Transform3d(new Translation3d(), new Rotation3d()),
|
||||
0.25,
|
||||
|
||||
@@ -53,6 +53,8 @@ TEST(PacketTest, PhotonTrackedTarget) {
|
||||
9.0,
|
||||
-5.0,
|
||||
-1,
|
||||
-1,
|
||||
-1.0,
|
||||
frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
frc::Rotation3d(1_rad, 2_rad, 3_rad)),
|
||||
frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
@@ -87,6 +89,8 @@ TEST(PacketTest, PhotonPipelineResult) {
|
||||
9.0,
|
||||
4.0,
|
||||
1,
|
||||
-1,
|
||||
-1.0,
|
||||
frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
frc::Rotation3d(1_rad, 2_rad, 3_rad)),
|
||||
frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
@@ -100,6 +104,8 @@ TEST(PacketTest, PhotonPipelineResult) {
|
||||
9.1,
|
||||
6.7,
|
||||
-1,
|
||||
-1,
|
||||
-1.0,
|
||||
frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
frc::Rotation3d(1_rad, 2_rad, 3_rad)),
|
||||
frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
|
||||
@@ -40,6 +40,8 @@ TEST(PhotonPipelineResultTest, Roundtrip) {
|
||||
9.0,
|
||||
4.0,
|
||||
1,
|
||||
-1,
|
||||
-1.0,
|
||||
frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
frc::Rotation3d(1_rad, 2_rad, 3_rad)),
|
||||
frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
@@ -53,6 +55,8 @@ TEST(PhotonPipelineResultTest, Roundtrip) {
|
||||
9.1,
|
||||
6.7,
|
||||
-1,
|
||||
-1,
|
||||
-1.0,
|
||||
frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
frc::Rotation3d(1_rad, 2_rad, 3_rad)),
|
||||
frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
|
||||
@@ -27,6 +27,8 @@ TEST(PhotonTrackedTargetTest, Roundtrip) {
|
||||
9.0,
|
||||
-5.0,
|
||||
-1,
|
||||
-1,
|
||||
-1.0,
|
||||
frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
frc::Rotation3d(1_rad, 2_rad, 3_rad)),
|
||||
frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
|
||||
Reference in New Issue
Block a user