Fix uninitialized variables in PhotonPipelineResult (#282)

If the default constructor is used, some member variables weren't properly initialized.
This commit is contained in:
Tyler Veness
2021-09-02 20:48:05 -07:00
committed by GitHub
parent 6767781a41
commit affb27038b
5 changed files with 4 additions and 6 deletions

View File

@@ -22,7 +22,7 @@ allprojects {
apply from: "versioningHelper.gradle"
ext {
wpilibVersion = "2021.2.1"
wpilibVersion = "2021.3.1"
opencvVersion = "3.4.7-5"
joglVersion = "2.4.0-rc-20200307"
pubVersion = versionString

View File

@@ -24,7 +24,6 @@ public class SimVisionTarget {
double targetWidthMeters;
double targetHeightMeters;
double targetHeightAboveGroundMeters;
double targetInfill_pct;
double tgtAreaMeters2;
/**

View File

@@ -92,8 +92,8 @@ class PhotonPipelineResult {
friend Packet& operator>>(Packet& packet, PhotonPipelineResult& result);
private:
units::second_t latency;
bool hasTargets;
units::second_t latency = 0_s;
bool hasTargets = false;
wpi::SmallVector<PhotonTrackedTarget, 10> targets;
inline static bool HAS_WARNED = false;
};

View File

@@ -38,7 +38,6 @@ class SimVisionTarget {
units::meter_t targetHeightAboveGround;
units::meter_t targetWidth;
units::meter_t targetHeight;
double targetInfill_pct;
units::square_meter_t tgtArea;
};

View File

@@ -42,7 +42,7 @@ dependencies {
compile "edu.wpi.first.thirdparty.frc2021.opencv:opencv-jni:$opencvVersion:osxx86-64"
compile "edu.wpi.first.thirdparty.frc2021.opencv:opencv-jni:$opencvVersion:windowsx86-64"
implementation "edu.wpi.first.wpimath:wpimath-java:2021.1.2-9-g26584ff"
implementation "edu.wpi.first.wpimath:wpimath-java:2021.3.1"
// test stuff
testImplementation("org.junit.jupiter:junit-jupiter:5.6.0")