mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-01 02:41:42 +00:00
Clean up C++ headers (#2402)
This commit is contained in:
@@ -17,20 +17,14 @@
|
||||
|
||||
#include "net/TimeSyncClient.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <wpi/Logger.h>
|
||||
#include <wpi/print.h>
|
||||
#include <wpi/struct/Struct.h>
|
||||
#include <wpinet/UDPClient.h>
|
||||
#include <wpinet/uv/util.h>
|
||||
|
||||
#include "ntcore_cpp.h"
|
||||
|
||||
@@ -17,22 +17,18 @@
|
||||
|
||||
#include "net/TimeSyncServer.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
|
||||
#include <ntcore_cpp.h>
|
||||
#include <wpi/Logger.h>
|
||||
#include <wpi/print.h>
|
||||
#include <wpi/struct/Struct.h>
|
||||
#include <wpinet/UDPClient.h>
|
||||
#include <wpinet/uv/util.h>
|
||||
|
||||
#include "ntcore_cpp.h"
|
||||
#include "net/TimeSyncStructs.h"
|
||||
|
||||
static void ServerLoggerFunc(unsigned int level, const char* file,
|
||||
unsigned int line, const char* msg) {
|
||||
|
||||
@@ -17,11 +17,8 @@
|
||||
|
||||
#include "photon/constrained_solvepnp/wrap/casadi_wrapper.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include <Eigen/Cholesky>
|
||||
#include <Eigen/Core>
|
||||
@@ -192,10 +189,10 @@ constrained_solvepnp::do_optimization(
|
||||
fmt::println("{} tags", nTags);
|
||||
// fmt::println("nstate {}", nState);
|
||||
|
||||
std::cout << "robot2camera:\n" << robot2camera << std::endl;
|
||||
std::cout << "x guess:\n" << x_guess << std::endl;
|
||||
std::cout << "field2pt:\n" << field2points << std::endl;
|
||||
std::cout << "observations:\n" << point_observations << std::endl;
|
||||
fmt::println("robot2camera:\n{}", robot2camera);
|
||||
fmt::println("x guess:\n{}", x_guess);
|
||||
fmt::println("field2pt:\n{}", field2points);
|
||||
fmt::println("observations:\n{}", point_observations);
|
||||
fmt::println("---------^^^^^^^^---------");
|
||||
}
|
||||
|
||||
@@ -252,7 +249,7 @@ constrained_solvepnp::do_optimization(
|
||||
|
||||
auto H_ldlt = H.ldlt();
|
||||
if (H_ldlt.info() != Eigen::Success) {
|
||||
std::cerr << "LDLT decomp failed! H=" << std::endl << H << std::endl;
|
||||
fmt::println(stderr, "LDLT decomp failed! H=\n{}", H);
|
||||
return wpi::unexpected{slp::ExitStatus::LOCALLY_INFEASIBLE};
|
||||
}
|
||||
|
||||
@@ -276,7 +273,7 @@ constrained_solvepnp::do_optimization(
|
||||
H_ldlt = H_reg.ldlt();
|
||||
|
||||
if (H_ldlt.info() != Eigen::Success) {
|
||||
std::cerr << "LDLT decomp failed! H=" << std::endl << H << std::endl;
|
||||
fmt::println(stderr, "LDLT decomp failed! H=\n{}", H);
|
||||
return wpi::unexpected{slp::ExitStatus::LOCALLY_INFEASIBLE};
|
||||
}
|
||||
|
||||
|
||||
@@ -17,13 +17,10 @@
|
||||
|
||||
#include "photon/estimation/VisionEstimation.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "photon/constrained_solvepnp/wrap/casadi_wrapper.h"
|
||||
#include "photon/estimation/OpenCVHelp.h"
|
||||
#include "photon/targeting/MultiTargetPNPResult.h"
|
||||
|
||||
namespace photon {
|
||||
namespace VisionEstimation {
|
||||
|
||||
@@ -17,14 +17,4 @@
|
||||
|
||||
#include "photon/targeting/PhotonTrackedTarget.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <frc/geometry/Translation2d.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
static constexpr const uint8_t MAX_CORNERS = 8;
|
||||
|
||||
namespace photon {} // namespace photon
|
||||
|
||||
@@ -17,31 +17,21 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
#include <frc/filter/MedianFilter.h>
|
||||
#include <wpi/Logger.h>
|
||||
#include <wpi/print.h>
|
||||
#include <wpi/static_circular_buffer.h>
|
||||
#include <wpi/struct/Struct.h>
|
||||
#include <wpinet/EventLoopRunner.h>
|
||||
#include <wpinet/UDPClient.h>
|
||||
#include <wpinet/uv/Buffer.h>
|
||||
#include <wpinet/uv/Timer.h>
|
||||
#include <wpinet/uv/Udp.h>
|
||||
|
||||
#include "TimeSyncStructs.h"
|
||||
#include "ntcore_cpp.h"
|
||||
|
||||
namespace wpi {
|
||||
namespace tsp {
|
||||
|
||||
@@ -17,30 +17,18 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
#include <wpi/Logger.h>
|
||||
#include <wpi/print.h>
|
||||
#include <wpi/struct/Struct.h>
|
||||
#include <wpinet/EventLoopRunner.h>
|
||||
#include <wpinet/UDPClient.h>
|
||||
#include <wpinet/uv/Buffer.h>
|
||||
#include <wpinet/uv/Timer.h>
|
||||
#include <wpinet/uv/Udp.h>
|
||||
|
||||
#include "TimeSyncStructs.h"
|
||||
#include "ntcore_cpp.h"
|
||||
|
||||
namespace wpi {
|
||||
namespace tsp {
|
||||
|
||||
|
||||
@@ -17,17 +17,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <bit>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include <concepts>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include <wpi/Demangle.h>
|
||||
#include <wpi/ct_string.h>
|
||||
#include <wpi/struct/Struct.h>
|
||||
|
||||
namespace photon {
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#define OPENCV_DISABLE_EIGEN_TENSOR_SUPPORT
|
||||
#include <opencv2/core/eigen.hpp>
|
||||
|
||||
#include "photon/targeting/MultiTargetPNPResult.h"
|
||||
#include "photon/targeting/PnpResult.h"
|
||||
#include "photon/targeting/TargetCorner.h"
|
||||
|
||||
|
||||
@@ -102,7 +102,5 @@ class NTTopicSet {
|
||||
cameraDistortionPublisher =
|
||||
subTable->GetDoubleArrayTopic("cameraDistortion").Publish();
|
||||
}
|
||||
|
||||
private:
|
||||
};
|
||||
} // namespace photon
|
||||
|
||||
@@ -19,11 +19,6 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <frc/geometry/Transform3d.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
#include "PnpResult.h"
|
||||
#include "photon/dataflow/structures/Packet.h"
|
||||
#include "photon/struct/MultiTargetPNPResultStruct.h"
|
||||
|
||||
namespace photon {
|
||||
|
||||
@@ -18,16 +18,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include <units/time.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
#include "MultiTargetPNPResult.h"
|
||||
#include "PhotonTrackedTarget.h"
|
||||
#include "fmt/base.h"
|
||||
#include "photon/dataflow/structures/Packet.h"
|
||||
#include "photon/struct/PhotonPipelineResultStruct.h"
|
||||
|
||||
namespace photon {
|
||||
|
||||
@@ -17,13 +17,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <frc/geometry/Transform3d.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
#include "photon/struct/PhotonTrackedTargetStruct.h"
|
||||
|
||||
|
||||
@@ -19,9 +19,6 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <frc/geometry/Transform3d.h>
|
||||
|
||||
#include "photon/dataflow/structures/Packet.h"
|
||||
#include "photon/struct/PnpResultStruct.h"
|
||||
|
||||
namespace photon {
|
||||
|
||||
@@ -15,13 +15,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <span>
|
||||
#include <vector>
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include <fmt/ranges.h>
|
||||
|
||||
#include "org_photonvision_jni_ConstrainedSolvepnpJni.h"
|
||||
#include "photon/constrained_solvepnp/wrap/casadi_wrapper.h"
|
||||
|
||||
@@ -72,18 +68,6 @@ Java_org_photonvision_jni_ConstrainedSolvepnpJni_do_1optimization
|
||||
pointObservationsMat(pointObservationsVec.data(), 2,
|
||||
pointObservationsVec.size() / 2);
|
||||
|
||||
#if 0
|
||||
fmt::println("======================================================");
|
||||
fmt::println("Got robot2camera raw {}", robot2cameraVec);
|
||||
fmt::println("Camera cal {} {} {} {}", cameraCal_.fx, cameraCal_.fy,
|
||||
cameraCal_.cx, cameraCal_.cy);
|
||||
fmt::println("{} tags", nTags);
|
||||
std::cout << "robot2camera:\n" << robot2cameraMat << std::endl;
|
||||
std::cout << "x guess:\n" << xGuessMat << std::endl;
|
||||
std::cout << "field2pt:\n" << field2pointsMat << std::endl;
|
||||
std::cout << "observations:\n" << pointObservationsMat << std::endl;
|
||||
#endif
|
||||
|
||||
wpi::expected<constrained_solvepnp::RobotStateMat, slp::ExitStatus> result =
|
||||
constrained_solvepnp::do_optimization(
|
||||
headingFree, nTags, cameraCal_, robot2cameraMat, xGuessMat,
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include <org_photonvision_jni_TimeSyncClient.h>
|
||||
#include <org_photonvision_jni_TimeSyncServer.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user