mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-22 01:11:40 +00:00
Bump to WPILib 2025 Beta 1 & remove C++ protobuf (#1484)
Remove C++ protobuf support until https://github.com/wpilibsuite/allwpilib/issues/7250 is addressed. Developers should upgrade to wpilib vscode 2025 beta 1. --------- Co-authored-by: Matt <matthew.morley.ca@gmail.com>
This commit is contained in:
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Photon Vision.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "photon.pb.h"
|
||||
#include "photon/targeting/MultiTargetPNPResult.h"
|
||||
#include "photon/targeting/proto/MultiTargetPNPResultProto.h"
|
||||
|
||||
// TEST(MultiTargetPNPResultTest, Roundtrip) {
|
||||
// photon::MultiTargetPNPResult result;
|
||||
|
||||
// google::protobuf::Arena arena;
|
||||
// google::protobuf::Message* proto =
|
||||
// wpi::Protobuf<photon::MultiTargetPNPResult>::New(&arena);
|
||||
// wpi::Protobuf<photon::MultiTargetPNPResult>::Pack(proto, result);
|
||||
|
||||
// photon::MultiTargetPNPResult unpacked_data =
|
||||
// wpi::Protobuf<photon::MultiTargetPNPResult>::Unpack(*proto);
|
||||
|
||||
// EXPECT_EQ(result, unpacked_data);
|
||||
|
||||
// photon::PnpResult pnpRes{
|
||||
// true,
|
||||
// frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
// frc::Rotation3d(1_rad, 2_rad, 3_rad)),
|
||||
// 0.1,
|
||||
// frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
// frc::Rotation3d(1_rad, 2_rad, 3_rad)),
|
||||
// 0.1,
|
||||
// 0};
|
||||
|
||||
// photon::MultiTargetPNPResult result1{pnpRes, {1, 2, 3, 4}};
|
||||
|
||||
// proto = wpi::Protobuf<photon::MultiTargetPNPResult>::New(&arena);
|
||||
// wpi::Protobuf<photon::MultiTargetPNPResult>::Pack(proto, result1);
|
||||
|
||||
// photon::MultiTargetPNPResult unpacked_data1 =
|
||||
// wpi::Protobuf<photon::MultiTargetPNPResult>::Unpack(*proto);
|
||||
|
||||
// EXPECT_EQ(result1, unpacked_data1);
|
||||
// }
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Photon Vision.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "photon.pb.h"
|
||||
#include "photon/targeting/PnpResult.h"
|
||||
#include "photon/targeting/proto/PNPResultProto.h"
|
||||
|
||||
// TEST(PnpResultTest, Roundtrip) {
|
||||
// photon::PnpResult result;
|
||||
|
||||
// google::protobuf::Arena arena;
|
||||
// google::protobuf::Message* proto =
|
||||
// wpi::Protobuf<photon::PnpResult>::New(&arena);
|
||||
// wpi::Protobuf<photon::PnpResult>::Pack(proto, result);
|
||||
|
||||
// photon::PnpResult unpacked_data =
|
||||
// wpi::Protobuf<photon::PnpResult>::Unpack(*proto);
|
||||
|
||||
// EXPECT_EQ(result, unpacked_data);
|
||||
|
||||
// photon::PnpResult result1{
|
||||
// true,
|
||||
// frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
// frc::Rotation3d(1_rad, 2_rad, 3_rad)),
|
||||
// 0.1,
|
||||
// frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
// frc::Rotation3d(1_rad, 2_rad, 3_rad)),
|
||||
// 0.1,
|
||||
// 0};
|
||||
|
||||
// proto = wpi::Protobuf<photon::PnpResult>::New(&arena);
|
||||
// wpi::Protobuf<photon::PnpResult>::Pack(proto, result1);
|
||||
|
||||
// photon::PnpResult unpacked_data2 =
|
||||
// wpi::Protobuf<photon::PnpResult>::Unpack(*proto);
|
||||
|
||||
// EXPECT_EQ(result1, unpacked_data2);
|
||||
// }
|
||||
@@ -1,101 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Photon Vision.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "photon.pb.h"
|
||||
#include "photon/targeting/PhotonPipelineResult.h"
|
||||
#include "photon/targeting/proto/PhotonPipelineResultProto.h"
|
||||
|
||||
// TEST(PhotonPipelineResultTest, Roundtrip) {
|
||||
// photon::PhotonPipelineResult result{0, 0_s, 12_ms, {}};
|
||||
|
||||
// google::protobuf::Arena arena;
|
||||
// google::protobuf::Message* proto =
|
||||
// wpi::Protobuf<photon::PhotonPipelineResult>::New(&arena);
|
||||
// wpi::Protobuf<photon::PhotonPipelineResult>::Pack(proto, result);
|
||||
|
||||
// photon::PhotonPipelineResult unpacked_data =
|
||||
// wpi::Protobuf<photon::PhotonPipelineResult>::Unpack(*proto);
|
||||
|
||||
// EXPECT_EQ(result, unpacked_data);
|
||||
|
||||
// wpi::SmallVector<photon::PhotonTrackedTarget, 2> targets{
|
||||
// photon::PhotonTrackedTarget{
|
||||
// 3.0,
|
||||
// -4.0,
|
||||
// 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),
|
||||
// frc::Rotation3d(1_rad, 2_rad, 3_rad)),
|
||||
// -1,
|
||||
// {std::pair{1, 2}, std::pair{3, 4}, std::pair{5, 6}, std::pair{7,
|
||||
// 8}}, {std::pair{1, 2}, std::pair{3, 4}, std::pair{5, 6},
|
||||
// std::pair{7, 8}}},
|
||||
// photon::PhotonTrackedTarget{
|
||||
// 3.0,
|
||||
// -4.0,
|
||||
// 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),
|
||||
// frc::Rotation3d(1_rad, 2_rad, 3_rad)),
|
||||
// -1,
|
||||
// {std::pair{1, 2}, std::pair{3, 4}, std::pair{5, 6}, std::pair{7,
|
||||
// 8}}, {std::pair{1, 2}, std::pair{3, 4}, std::pair{5, 6},
|
||||
// std::pair{7, 8}}}};
|
||||
|
||||
// photon::PhotonPipelineResult result2{0, 0_s, 12_ms, targets};
|
||||
|
||||
// proto = wpi::Protobuf<photon::PhotonPipelineResult>::New(&arena);
|
||||
// wpi::Protobuf<photon::PhotonPipelineResult>::Pack(proto, result2);
|
||||
|
||||
// photon::PhotonPipelineResult unpacked_data2 =
|
||||
// wpi::Protobuf<photon::PhotonPipelineResult>::Unpack(*proto);
|
||||
|
||||
// EXPECT_EQ(result2, unpacked_data2);
|
||||
|
||||
// photon::PnpResult pnpRes{
|
||||
// true,
|
||||
// frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
// frc::Rotation3d(1_rad, 2_rad, 3_rad)),
|
||||
// 0.1,
|
||||
// frc::Transform3d(frc::Translation3d(1_m, 2_m, 3_m),
|
||||
// frc::Rotation3d(1_rad, 2_rad, 3_rad)),
|
||||
// 0.1,
|
||||
// 0};
|
||||
|
||||
// photon::MultiTargetPNPResult multitagRes{pnpRes, {1, 2, 3, 4}};
|
||||
|
||||
// photon::PhotonPipelineResult result3{0, 0_s, 12_ms, targets, multitagRes};
|
||||
|
||||
// proto = wpi::Protobuf<photon::PhotonPipelineResult>::New(&arena);
|
||||
// wpi::Protobuf<photon::PhotonPipelineResult>::Pack(proto, result3);
|
||||
|
||||
// photon::PhotonPipelineResult unpacked_data3 =
|
||||
// wpi::Protobuf<photon::PhotonPipelineResult>::Unpack(*proto);
|
||||
|
||||
// EXPECT_EQ(result3, unpacked_data3);
|
||||
// }
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Photon Vision.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "photon.pb.h"
|
||||
#include "photon/targeting/PhotonTrackedTarget.h"
|
||||
#include "photon/targeting/proto/PhotonTrackedTargetProto.h"
|
||||
|
||||
// TEST(PhotonTrackedTargetTest, Roundtrip) {
|
||||
// photon::PhotonTrackedTarget target{
|
||||
// 3.0,
|
||||
// 4.0,
|
||||
// 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),
|
||||
// frc::Rotation3d(1_rad, 2_rad, 3_rad)),
|
||||
// -1,
|
||||
// {std::pair{1, 2}, std::pair{3, 4}, std::pair{5, 6}, std::pair{7, 8}},
|
||||
// {std::pair{1, 2}, std::pair{3, 4}, std::pair{5, 6}, std::pair{7, 8}}};
|
||||
|
||||
// google::protobuf::Arena arena;
|
||||
// google::protobuf::Message* proto =
|
||||
// wpi::Protobuf<photon::PhotonTrackedTarget>::New(&arena);
|
||||
// wpi::Protobuf<photon::PhotonTrackedTarget>::Pack(proto, target);
|
||||
|
||||
// photon::PhotonTrackedTarget unpacked_data =
|
||||
// wpi::Protobuf<photon::PhotonTrackedTarget>::Unpack(*proto);
|
||||
|
||||
// EXPECT_EQ(target, unpacked_data);
|
||||
// }
|
||||
Reference in New Issue
Block a user