Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Add missing JavaDocs #6125

Merged
merged 1 commit into from
Jan 2, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions apriltag/src/main/java/edu/wpi/first/apriltag/AprilTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,23 @@
import edu.wpi.first.util.RawFrame;
import java.util.Objects;

/** Represents an AprilTag's metadata. */
@SuppressWarnings("MemberName")
public class AprilTag {
/** The tag's ID. */
@JsonProperty(value = "ID")
public int ID;

/** The tag's pose. */
@JsonProperty(value = "pose")
public Pose3d pose;

/**
* Constructs an AprilTag.
*
* @param ID The tag's ID.
* @param pose The tag's pose.
*/
@SuppressWarnings("ParameterName")
@JsonCreator
public AprilTag(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ public boolean equals(Object obj) {
}
}

/** Constructs an AprilTagDetector. */
public AprilTagDetector() {
m_native = AprilTagJNI.createDetector();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,36 @@
import java.io.IOException;
import java.util.concurrent.atomic.AtomicBoolean;

/** AprilTag JNI. */
public class AprilTagJNI {
static boolean libraryLoaded = false;

static RuntimeLoader<AprilTagJNI> loader = null;

/** Sets whether JNI should be loaded in the static block. */
public static class Helper {
private static AtomicBoolean extractOnStaticLoad = new AtomicBoolean(true);

/**
* Returns true if the JNI should be loaded in the static block.
*
* @return True if the JNI should be loaded in the static block.
*/
public static boolean getExtractOnStaticLoad() {
return extractOnStaticLoad.get();
}

/**
* Sets whether the JNI should be loaded in the static block.
*
* @param load Whether the JNI should be loaded in the static block.
*/
public static void setExtractOnStaticLoad(boolean load) {
extractOnStaticLoad.set(load);
}

/** Utility class. */
private Helper() {}
}

static {
Expand Down Expand Up @@ -194,4 +209,7 @@ public static native Transform3d estimatePose(
public static native void generate16h5AprilTagImage(RawFrame frameObj, long frame, int id);

public static native void generate36h11AprilTagImage(RawFrame frameObj, long frame, int id);

/** Utility class. */
private AprilTagJNI() {}
}
8 changes: 5 additions & 3 deletions apriltag/src/main/native/include/frc/apriltag/AprilTag.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@

namespace frc {

/**
* Represents an AprilTag's metadata.
*/
struct WPILIB_DLLEXPORT AprilTag {
/// The tag's ID.
int ID;

/// The tag's pose.
Pose3d pose;

/**
* Checks equality between this AprilTag and another object.
*/
bool operator==(const AprilTag&) const = default;

static bool Generate36h11AprilTagImage(wpi::RawFrame* frame, int id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* code. The easiest way to use this is to run it in a {@link VisionThread} and use the listener to
* take snapshots of the pipeline's outputs.
*
* @param <P> Vision pipeline type.
* @see VisionPipeline
* @see VisionThread
* @see <a href="package-summary.html">vision</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,36 @@
import java.util.concurrent.atomic.AtomicBoolean;
import org.opencv.core.Core;

/** CameraServer CV JNI. */
public class CameraServerCvJNI {
static boolean libraryLoaded = false;

static RuntimeLoader<Core> loader = null;

/** Sets whether JNI should be loaded in the static block. */
public static class Helper {
private static AtomicBoolean extractOnStaticLoad = new AtomicBoolean(true);

/**
* Returns true if the JNI should be loaded in the static block.
*
* @return True if the JNI should be loaded in the static block.
*/
public static boolean getExtractOnStaticLoad() {
return extractOnStaticLoad.get();
}

/**
* Sets whether the JNI should be loaded in the static block.
*
* @param load Whether the JNI should be loaded in the static block.
*/
public static void setExtractOnStaticLoad(boolean load) {
extractOnStaticLoad.set(load);
}

/** Utility class. */
private Helper() {}
}

static {
Expand Down Expand Up @@ -72,4 +87,7 @@ public static native int createCvSource(
public static native long grabSinkFrame(int sink, long imageNativeObj);

public static native long grabSinkFrameTimeout(int sink, long imageNativeObj, double timeout);

/** Utility class. */
private CameraServerCvJNI() {}
}
18 changes: 18 additions & 0 deletions cscore/src/main/java/edu/wpi/first/cscore/CameraServerJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,36 @@
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Consumer;

/** CameraServer JNI. */
public class CameraServerJNI {
static boolean libraryLoaded = false;

static RuntimeLoader<CameraServerJNI> loader = null;

/** Sets whether JNI should be loaded in the static block. */
public static class Helper {
private static AtomicBoolean extractOnStaticLoad = new AtomicBoolean(true);

/**
* Returns true if the JNI should be loaded in the static block.
*
* @return True if the JNI should be loaded in the static block.
*/
public static boolean getExtractOnStaticLoad() {
return extractOnStaticLoad.get();
}

/**
* Sets whether the JNI should be loaded in the static block.
*
* @param load Whether the JNI should be loaded in the static block.
*/
public static void setExtractOnStaticLoad(boolean load) {
extractOnStaticLoad.set(load);
}

/** Utility class. */
private Helper() {}
}

static {
Expand Down Expand Up @@ -347,4 +362,7 @@ public interface LoggerFunction {
public static native int runMainRunLoopTimeout(double timeoutSeconds);

public static native void stopMainRunLoop();

/** Utility class. */
private CameraServerJNI() {}
}
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/AccelerometerJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,7 @@ public class AccelerometerJNI extends JNIWrapper {
* @return the Z acceleration
*/
public static native double getAccelerometerZ();

/** Utility class. */
private AccelerometerJNI() {}
}
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/AccumulatorResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ public class AccumulatorResult {
/** The number of sample value was accumulated over. */
public long count;

/** Constructs an AccumulatorResult. */
public AccumulatorResult() {}

/**
* Set the value and count.
*
Expand Down
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/AddressableLEDJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,7 @@ public static native void setBitTiming(
* @see "HAL_StopAddressableLEDOutput"
*/
public static native void stop(int handle);

/** Utility class. */
private AddressableLEDJNI() {}
}
8 changes: 8 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/AllianceStationID.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@

package edu.wpi.first.hal;

/** Alliance station ID. */
public enum AllianceStationID {
/** Unknown. */
Unknown,
/** Red 1. */
Red1,
/** Red 2. */
Red2,
/** Red 3. */
Red3,
/** Blue 1. */
Blue1,
/** Blue 2. */
Blue2,
/** Blue 3. */
Blue3
}
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/AnalogGyroJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,7 @@ public static native void setAnalogGyroVoltsPerDegreePerSecond(
* @see "HAL_GetAnalogGyroCenter"
*/
public static native int getAnalogGyroCenter(int handle);

/** Utility class. */
private AnalogGyroJNI() {}
}
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/AnalogJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -497,4 +497,7 @@ public static native void setAnalogTriggerFiltered(
* @see "HAL_GetAnalogTriggerFPGAIndex"
*/
public static native int getAnalogTriggerFPGAIndex(int analogTriggerHandle);

/** Utility class. */
private AnalogJNI() {}
}
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/CANAPIJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,7 @@ public static native int writeCANPacketRepeatingNoThrow(
*/
public static native boolean readCANPacketTimeout(
int handle, int apiId, int timeoutMs, CANData data);

/** Utility class. */
private CANAPIJNI() {}
}
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/CTREPCMJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,7 @@ public class CTREPCMJNI extends JNIWrapper {
* @see "HAL_SetCTREPCMOneShotDuration"
*/
public static native void setOneShotDuration(int handle, int index, int durMs);

/** Utility class. */
private CTREPCMJNI() {}
}
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/ConstantsJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ public class ConstantsJNI extends JNIWrapper {
* @see "HAL_GetSystemClockTicksPerMicrosecond"
*/
public static native int getSystemClockTicksPerMicrosecond();

/** Utility class. */
private ConstantsJNI() {}
}
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/CounterJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,7 @@ public static native void setCounterDownSourceEdge(
* @see "HAL_SetCounterReverseDirection"
*/
public static native void setCounterReverseDirection(int counterHandle, boolean reverseDirection);

/** Utility class. */
private CounterJNI() {}
}
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/DIOJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,7 @@ public class DIOJNI extends JNIWrapper {
* @see "HAL_SetDigitalPWMOutputChannel"
*/
public static native void setDigitalPWMOutputChannel(int pwmGenerator, int channel);

/** Utility class. */
DIOJNI() {}
calcmogul marked this conversation as resolved.
Show resolved Hide resolved
}
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/DMAJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,7 @@ public static native long readDMA(
* @return The DMA sample
*/
public static native DMAJNISample.BaseStore getSensorReadData(int handle);

/** Utility class. */
private DMAJNI() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,7 @@ public class DigitalGlitchFilterJNI extends JNIWrapper {
* @see "HAL_GetFilterPeriod"
*/
public static native int getFilterPeriod(int filterIndex);

/** Utility class. */
private DigitalGlitchFilterJNI() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -372,5 +372,6 @@ public static native int sendError(
*/
public static native boolean getOutputsActive();

/** Utility class. */
private DriverStationJNI() {}
}
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/DutyCycleJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,7 @@ public class DutyCycleJNI extends JNIWrapper {
* @see "HAL_GetDutyCycleFPGAIndex"
*/
public static native int getFPGAIndex(int handle);

/** Utility class. */
private DutyCycleJNI() {}
}
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/EncoderJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,7 @@ public static native void setEncoderIndexSource(
* @see "HAL_GetEncoderEncodingType"
*/
public static native int getEncoderEncodingType(int encoderHandle);

/** Utility class. */
private EncoderJNI() {}
}
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/I2CJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,7 @@ public static native int i2CRead(
* @see "HAL_CloseI2C"
*/
public static native void i2CClose(int port);

/** Utility class. */
private I2CJNI() {}
}
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/InterruptJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,7 @@ public static native void setInterruptUpSourceEdge(
* @see "HAL_ReleaseWaitingInterrupt"
*/
public static native void releaseWaitingInterrupt(int interruptHandle);

/** Utility class. */
private InterruptJNI() {}
}
17 changes: 17 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/JNIWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,30 @@ public class JNIWrapper {
static boolean libraryLoaded = false;
static RuntimeLoader<JNIWrapper> loader = null;

/** Sets whether JNI should be loaded in the static block. */
public static class Helper {
private static AtomicBoolean extractOnStaticLoad = new AtomicBoolean(true);

/**
* Returns true if the JNI should be loaded in the static block.
*
* @return True if the JNI should be loaded in the static block.
*/
public static boolean getExtractOnStaticLoad() {
return extractOnStaticLoad.get();
}

/**
* Sets whether the JNI should be loaded in the static block.
*
* @param load Whether the JNI should be loaded in the static block.
*/
public static void setExtractOnStaticLoad(boolean load) {
extractOnStaticLoad.set(load);
}

/** Utility class. */
private Helper() {}
}

static {
Expand Down Expand Up @@ -57,4 +71,7 @@ public static synchronized void forceLoad() throws IOException {
}

public static void suppressUnused(Object object) {}

/** Utility class. */
public JNIWrapper() {}
}
3 changes: 3 additions & 0 deletions hal/src/main/java/edu/wpi/first/hal/LEDJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ public class LEDJNI extends JNIWrapper {
* @see "HAL_GetRadioLEDState"
*/
public static native int getRadioLEDState();

/** Utility class. */
private LEDJNI() {}
}
Loading