Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
import org.wpilib.vision.apriltag.jni.AprilTagJNI;

/** Represents an AprilTag's metadata. */
@SuppressWarnings("MemberName")
@Json
public class AprilTag {
/** The tag's ID. */
@Json.Property("ID")
@SuppressWarnings("PMD.PublicFieldNamingConvention")
public int ID;

/** The tag's pose. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
public class AprilTagDetector implements AutoCloseable {
/** Detector configuration. */
@SuppressWarnings("MemberName")
public static class Config {
/**
* How many threads should be used for computation. Default is single-threaded operation (1
Expand Down Expand Up @@ -110,7 +109,6 @@ public boolean equals(Object obj) {
}

/** Quad threshold parameters. */
@SuppressWarnings("MemberName")
public static class QuadThresholdParameters {
/** Threshold used to reject quads containing too few pixels. Default is 300 pixels. */
public int minClusterPixels = 300;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public enum OriginPosition {
@Json.Ignore private final Map<Integer, AprilTag> m_apriltags = new HashMap<>();

@Json.Property("field")
@SuppressWarnings("PMD.PublicFieldNamingConvention")
FieldDimensions m_fieldDimensions;

@Json.Ignore private Pose3d m_origin;
Expand Down Expand Up @@ -216,19 +217,19 @@ public void serialize(Path path) throws IOException {
* @throws UncheckedIOException If the layout does not exist.
*/
public static AprilTagFieldLayout loadField(AprilTagFields field) {
if (field.m_fieldLayout == null) {
if (field.fieldLayout == null) {
try {
field.m_fieldLayout = loadFromResource(field.m_resourceFile);
field.fieldLayout = loadFromResource(field.resourceFile);
} catch (IOException e) {
throw new UncheckedIOException(
"Could not load AprilTagFieldLayout from " + field.m_resourceFile, e);
"Could not load AprilTagFieldLayout from " + field.resourceFile, e);
}
}
// Copy layout because the layout's origin is mutable
return new AprilTagFieldLayout(
field.m_fieldLayout.getTags(),
field.m_fieldLayout.getFieldLength(),
field.m_fieldLayout.getFieldWidth());
field.fieldLayout.getTags(),
field.fieldLayout.getFieldLength(),
field.fieldLayout.getFieldWidth());
}

/**
Expand Down Expand Up @@ -263,12 +264,11 @@ public int hashCode() {
return Objects.hash(m_apriltags, m_origin);
}

@SuppressWarnings("PMD.PublicMemberInNonPublicType")
static class FieldDimensions {
@SuppressWarnings("MemberName")
@Json.Property(value = "length")
public final double fieldLength;

@SuppressWarnings("MemberName")
@Json.Property(value = "width")
public final double fieldWidth;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public enum AprilTagFields {
public static final AprilTagFields kDefaultField = k2026RebuiltWelded;

/** Resource filename. */
public final String m_resourceFile;
public final String resourceFile;

AprilTagFieldLayout m_fieldLayout;
AprilTagFieldLayout fieldLayout;

AprilTagFields(String resourceFile) {
m_resourceFile = kBaseResourceDir + resourceFile;
this.resourceFile = kBaseResourceDir + resourceFile;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.wpilib.math.geometry.Transform3d;

/** A pair of AprilTag pose estimates. */
@SuppressWarnings("MemberName")
public class AprilTagPoseEstimate {
/**
* Constructs a pose estimate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/** Pose estimators for AprilTag tags. */
public class AprilTagPoseEstimator {
/** Configuration for the pose estimator. */
@SuppressWarnings("MemberName")
public static class Config {
/**
* Creates a pose estimator configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.wpilib.util.runtime.RuntimeLoader;

class AprilTagDetectorTest {
@SuppressWarnings("MemberName")
AprilTagDetector detector;

@BeforeAll
Expand Down Expand Up @@ -110,7 +109,7 @@ void testRemoveFamily() {
detector.removeFamily("tag16h5");
}

public Mat loadImage(String resource) throws IOException {
Mat loadImage(String resource) throws IOException {
Mat encoded;
try (InputStream is = getClass().getResource(resource).openStream()) {
try (ByteArrayOutputStream os = new ByteArrayOutputStream(is.available())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
public final class Main {
private static String configFile = "/boot/CameraServerConfig.json";

@SuppressWarnings("MemberName")
public static class CameraConfig {
public String name;
public String path;
Expand Down
Loading
Loading