diff --git a/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServer.java b/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServer.java index 501877c86d..8e4771f111 100644 --- a/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServer.java +++ b/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServer.java @@ -43,7 +43,11 @@ public final class CameraServer { private static final String kPublishName = "/CameraPublisher"; private static CameraServer server; - /** Get the CameraServer instance. */ + /** + * Get the CameraServer instance. + * + * @return CameraServer instance + */ public static synchronized CameraServer getInstance() { if (server == null) { server = new CameraServer(); @@ -522,6 +526,8 @@ public final class CameraServer { *
The first time this overload is called, it calls {@link #startAutomaticCapture(int)} with * device 0, creating a camera named "USB Camera 0". Subsequent calls increment the device number * (e.g. 1, 2, etc). + * + * @return The USB camera capturing images. */ public UsbCamera startAutomaticCapture() { UsbCamera camera = startAutomaticCapture(m_defaultUsbDevice.getAndIncrement()); @@ -536,6 +542,7 @@ public final class CameraServer { * {dev}". * * @param dev The device number of the camera interface + * @return The USB camera capturing images. */ public UsbCamera startAutomaticCapture(int dev) { UsbCamera camera = new UsbCamera("USB Camera " + dev, dev); @@ -549,6 +556,7 @@ public final class CameraServer { * * @param name The name to give the camera * @param dev The device number of the camera interface + * @return The USB camera capturing images. */ public UsbCamera startAutomaticCapture(String name, int dev) { UsbCamera camera = new UsbCamera(name, dev); @@ -562,6 +570,7 @@ public final class CameraServer { * * @param name The name to give the camera * @param path The device path (e.g. "/dev/video0") of the camera + * @return The USB camera capturing images. */ public UsbCamera startAutomaticCapture(String name, String path) { UsbCamera camera = new UsbCamera(name, path); @@ -574,6 +583,7 @@ public final class CameraServer { * Start automatically capturing images to send to the dashboard from an existing camera. * * @param camera Camera + * @return The MJPEG server serving images from the given camera. */ public MjpegServer startAutomaticCapture(VideoSource camera) { addCamera(camera); @@ -588,6 +598,7 @@ public final class CameraServer { *
This overload calls {@link #addAxisCamera(String, String)} with name "Axis Camera". * * @param host Camera host IP or DNS name (e.g. "10.x.y.11") + * @return The Axis camera capturing images. */ public AxisCamera addAxisCamera(String host) { return addAxisCamera("Axis Camera", host); @@ -599,6 +610,7 @@ public final class CameraServer { *
This overload calls {@link #addAxisCamera(String, String[])} with name "Axis Camera". * * @param hosts Array of Camera host IPs/DNS names + * @return The Axis camera capturing images. */ public AxisCamera addAxisCamera(String[] hosts) { return addAxisCamera("Axis Camera", hosts); @@ -609,6 +621,7 @@ public final class CameraServer { * * @param name The name to give the camera * @param host Camera host IP or DNS name (e.g. "10.x.y.11") + * @return The Axis camera capturing images. */ public AxisCamera addAxisCamera(String name, String host) { AxisCamera camera = new AxisCamera(name, host); @@ -623,6 +636,7 @@ public final class CameraServer { * * @param name The name to give the camera * @param hosts Array of Camera host IPs/DNS names + * @return The Axis camera capturing images. */ public AxisCamera addAxisCamera(String name, String[] hosts) { AxisCamera camera = new AxisCamera(name, hosts); @@ -636,6 +650,9 @@ public final class CameraServer { * Adds a virtual camera for switching between two streams. Unlike the other addCamera methods, * this returns a VideoSink rather than a VideoSource. Calling setSource() on the returned object * can be used to switch the actual source of the stream. + * + * @param name The name to give the camera + * @return The MJPEG server serving images from the given camera. */ public MjpegServer addSwitchedCamera(String name) { // create a dummy CvSource @@ -654,6 +671,8 @@ public final class CameraServer { * *
This is only valid to call after a camera feed has been added with startAutomaticCapture() * or addServer(). + * + * @return OpenCV sink for the primary camera feed */ public CvSink getVideo() { VideoSource source; @@ -674,6 +693,7 @@ public final class CameraServer { * image processing on the roboRIO. * * @param camera Camera (e.g. as returned by startAutomaticCapture). + * @return OpenCV sink for the specified camera */ public CvSink getVideo(VideoSource camera) { String name = "opencv_" + camera.getName(); @@ -700,6 +720,7 @@ public final class CameraServer { * image processing on the roboRIO. * * @param name Camera name + * @return OpenCV sink for the specified camera */ public CvSink getVideo(String name) { VideoSource source; @@ -719,6 +740,7 @@ public final class CameraServer { * @param name Name to give the stream * @param width Width of the image being sent * @param height Height of the image being sent + * @return OpenCV source for the MJPEG stream */ public CvSource putVideo(String name, int width, int height) { CvSource source = new CvSource(name, VideoMode.PixelFormat.kMJPEG, width, height, 30); @@ -730,6 +752,7 @@ public final class CameraServer { * Adds a MJPEG server at the next available port. * * @param name Server name + * @return The MJPEG server */ public MjpegServer addServer(String name) { int port; @@ -744,6 +767,8 @@ public final class CameraServer { * Adds a MJPEG server. * * @param name Server name + * @param port Server port + * @return The MJPEG server */ public MjpegServer addServer(String name, int port) { MjpegServer server = new MjpegServer(name, port); @@ -778,6 +803,8 @@ public final class CameraServer { * *
This is only valid to call after a camera feed has been added with startAutomaticCapture() * or addServer(). + * + * @return The server for the primary camera feed */ public VideoSink getServer() { synchronized (this) { @@ -792,6 +819,7 @@ public final class CameraServer { * Gets a server by name. * * @param name Server name + * @return The server */ public VideoSink getServer(String name) { synchronized (this) { diff --git a/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServerSharedStore.java b/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServerSharedStore.java index 654c371a52..5ce6334e32 100644 --- a/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServerSharedStore.java +++ b/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServerSharedStore.java @@ -9,7 +9,11 @@ public final class CameraServerSharedStore { private CameraServerSharedStore() {} - /** get the CameraServerShared object. */ + /** + * Get the CameraServerShared object. + * + * @return The CameraServerSharedObject + */ public static synchronized CameraServerShared getCameraServerShared() { if (cameraServerShared == null) { cameraServerShared = @@ -36,7 +40,11 @@ public final class CameraServerSharedStore { return cameraServerShared; } - /** set the CameraServerShared object. */ + /** + * Set the CameraServerShared object. + * + * @param shared The CameraServerShared object. + */ public static synchronized void setCameraServerShared(CameraServerShared shared) { cameraServerShared = shared; } diff --git a/cameraserver/src/main/java/edu/wpi/first/vision/VisionPipeline.java b/cameraserver/src/main/java/edu/wpi/first/vision/VisionPipeline.java index 8ecec68df3..29c285f03e 100644 --- a/cameraserver/src/main/java/edu/wpi/first/vision/VisionPipeline.java +++ b/cameraserver/src/main/java/edu/wpi/first/vision/VisionPipeline.java @@ -17,6 +17,8 @@ public interface VisionPipeline { /** * Processes the image input and sets the result objects. Implementations should make these * objects accessible. + * + * @param image The image to process. */ void process(Mat image); } diff --git a/cameraserver/src/main/native/include/vision/VisionRunner.h b/cameraserver/src/main/native/include/vision/VisionRunner.h index 7c57e764e9..bda338e856 100644 --- a/cameraserver/src/main/native/include/vision/VisionRunner.h +++ b/cameraserver/src/main/native/include/vision/VisionRunner.h @@ -49,9 +49,9 @@ class VisionRunnerBase { void RunOnce(); /** - * A convenience method that calls {@link #runOnce()} in an infinite loop. - * This must be run in a dedicated thread, and cannot be used in the main - * robot thread because it will freeze the robot program. + * A convenience method that calls runOnce() in an infinite loop. This must be + * run in a dedicated thread, and cannot be used in the main robot thread + * because it will freeze the robot program. * * Do not call this method directly from the main thread. */ diff --git a/cscore/src/main/java/edu/wpi/first/cscore/CameraServerCvJNI.java b/cscore/src/main/java/edu/wpi/first/cscore/CameraServerCvJNI.java index 6d382c87db..627258caaa 100644 --- a/cscore/src/main/java/edu/wpi/first/cscore/CameraServerCvJNI.java +++ b/cscore/src/main/java/edu/wpi/first/cscore/CameraServerCvJNI.java @@ -42,7 +42,11 @@ public class CameraServerCvJNI { } } - /** Force load the library. */ + /** + * Force load the library. + * + * @throws IOException if library load failed + */ public static synchronized void forceLoad() throws IOException { if (libraryLoaded) { return; diff --git a/cscore/src/main/java/edu/wpi/first/cscore/CameraServerJNI.java b/cscore/src/main/java/edu/wpi/first/cscore/CameraServerJNI.java index b7a9216e82..cd7804a0d4 100644 --- a/cscore/src/main/java/edu/wpi/first/cscore/CameraServerJNI.java +++ b/cscore/src/main/java/edu/wpi/first/cscore/CameraServerJNI.java @@ -43,7 +43,11 @@ public class CameraServerJNI { } } - /** Force load the library. */ + /** + * Force load the library. + * + * @throws IOException if library load failed + */ public static synchronized void forceLoad() throws IOException { if (libraryLoaded) { return; diff --git a/cscore/src/main/java/edu/wpi/first/cscore/CvSink.java b/cscore/src/main/java/edu/wpi/first/cscore/CvSink.java index 28f0dd13a8..88ca8b1b54 100644 --- a/cscore/src/main/java/edu/wpi/first/cscore/CvSink.java +++ b/cscore/src/main/java/edu/wpi/first/cscore/CvSink.java @@ -38,6 +38,7 @@ public class CvSink extends ImageSink { * Wait for the next frame and get the image. Times out (returning 0) after 0.225 seconds. The * provided image will have three 3-bit channels stored in BGR order. * + * @param image Where to store the image. * @return Frame time, or 0 on error (call GetError() to obtain the error message) */ public long grabFrame(Mat image) { @@ -48,6 +49,8 @@ public class CvSink extends ImageSink { * Wait for the next frame and get the image. Times out (returning 0) after timeout seconds. The * provided image will have three 3-bit channels stored in BGR order. * + * @param image Where to store the image. + * @param timeout Retrieval timeout in seconds. * @return Frame time, or 0 on error (call GetError() to obtain the error message); the frame time * is in 1 us increments. */ @@ -59,6 +62,7 @@ public class CvSink extends ImageSink { * Wait for the next frame and get the image. May block forever. The provided image will have * three 3-bit channels stored in BGR order. * + * @param image Where to store the image. * @return Frame time, or 0 on error (call GetError() to obtain the error message); the frame time * is in 1 us increments. */ diff --git a/cscore/src/main/java/edu/wpi/first/cscore/HttpCamera.java b/cscore/src/main/java/edu/wpi/first/cscore/HttpCamera.java index 9758f90436..8c72350e63 100644 --- a/cscore/src/main/java/edu/wpi/first/cscore/HttpCamera.java +++ b/cscore/src/main/java/edu/wpi/first/cscore/HttpCamera.java @@ -88,17 +88,27 @@ public class HttpCamera extends VideoCamera { * Get the kind of HTTP camera. * *
Autodetection can result in returning a different value than the camera was created with.
+ *
+ * @return The kind of HTTP camera.
*/
public HttpCameraKind getHttpCameraKind() {
return getHttpCameraKindFromInt(CameraServerJNI.getHttpCameraKind(m_handle));
}
- /** Change the URLs used to connect to the camera. */
+ /**
+ * Change the URLs used to connect to the camera.
+ *
+ * @param urls Array of Camera URLs
+ */
public void setUrls(String[] urls) {
CameraServerJNI.setHttpCameraUrls(m_handle, urls);
}
- /** Get the URLs used to connect to the camera. */
+ /**
+ * Get the URLs used to connect to the camera.
+ *
+ * @return Array of camera URLs.
+ */
public String[] getUrls() {
return CameraServerJNI.getHttpCameraUrls(m_handle);
}
diff --git a/cscore/src/main/java/edu/wpi/first/cscore/ImageSink.java b/cscore/src/main/java/edu/wpi/first/cscore/ImageSink.java
index 55318da1cb..1c4cac2f18 100644
--- a/cscore/src/main/java/edu/wpi/first/cscore/ImageSink.java
+++ b/cscore/src/main/java/edu/wpi/first/cscore/ImageSink.java
@@ -18,7 +18,11 @@ public abstract class ImageSink extends VideoSink {
CameraServerJNI.setSinkDescription(m_handle, description);
}
- /** Get error string. Call this if WaitForFrame() returns 0 to determine what the error is. */
+ /**
+ * Get error string. Call this if WaitForFrame() returns 0 to determine what the error is.
+ *
+ * @return Error string.
+ */
public String getError() {
return CameraServerJNI.getSinkError(m_handle);
}
@@ -27,6 +31,8 @@ public abstract class ImageSink extends VideoSink {
* Enable or disable getting new frames. Disabling will cause processFrame (for callback-based
* CvSinks) to not be called and WaitForFrame() to not return. This can be used to save processor
* resources when frames are not needed.
+ *
+ * @param enabled Enable to get new frames.
*/
public void setEnabled(boolean enabled) {
CameraServerJNI.setSinkEnabled(m_handle, enabled);
diff --git a/cscore/src/main/java/edu/wpi/first/cscore/ImageSource.java b/cscore/src/main/java/edu/wpi/first/cscore/ImageSource.java
index 431e75cfa4..4ef05fd1bd 100644
--- a/cscore/src/main/java/edu/wpi/first/cscore/ImageSource.java
+++ b/cscore/src/main/java/edu/wpi/first/cscore/ImageSource.java
@@ -12,6 +12,8 @@ public abstract class ImageSource extends VideoSource {
/**
* Signal sinks that an error has occurred. This should be called instead of NotifyFrame when an
* error occurs.
+ *
+ * @param msg Error message.
*/
public void notifyError(String msg) {
CameraServerJNI.notifySourceError(m_handle, msg);
diff --git a/cscore/src/main/java/edu/wpi/first/cscore/MjpegServer.java b/cscore/src/main/java/edu/wpi/first/cscore/MjpegServer.java
index a1ffb6331d..54c8053b47 100644
--- a/cscore/src/main/java/edu/wpi/first/cscore/MjpegServer.java
+++ b/cscore/src/main/java/edu/wpi/first/cscore/MjpegServer.java
@@ -27,12 +27,20 @@ public class MjpegServer extends VideoSink {
this(name, "", port);
}
- /** Get the listen address of the server. */
+ /**
+ * Get the listen address of the server.
+ *
+ * @return The listen address.
+ */
public String getListenAddress() {
return CameraServerJNI.getMjpegServerListenAddress(m_handle);
}
- /** Get the port number of the server. */
+ /**
+ * Get the port number of the server.
+ *
+ * @return The port number.
+ */
public int getPort() {
return CameraServerJNI.getMjpegServerPort(m_handle);
}
diff --git a/cscore/src/main/java/edu/wpi/first/cscore/UsbCamera.java b/cscore/src/main/java/edu/wpi/first/cscore/UsbCamera.java
index 2b5cf5a41a..8e0817eb99 100644
--- a/cscore/src/main/java/edu/wpi/first/cscore/UsbCamera.java
+++ b/cscore/src/main/java/edu/wpi/first/cscore/UsbCamera.java
@@ -35,17 +35,29 @@ public class UsbCamera extends VideoCamera {
return CameraServerJNI.enumerateUsbCameras();
}
- /** Change the path to the device. */
+ /**
+ * Change the path to the device.
+ *
+ * @param path New device path.
+ */
void setPath(String path) {
CameraServerJNI.setUsbCameraPath(m_handle, path);
}
- /** Get the path to the device. */
+ /**
+ * Get the path to the device.
+ *
+ * @return The device path.
+ */
public String getPath() {
return CameraServerJNI.getUsbCameraPath(m_handle);
}
- /** Get the full camera information for the device. */
+ /**
+ * Get the full camera information for the device.
+ *
+ * @return The camera information.
+ */
public UsbCameraInfo getInfo() {
return CameraServerJNI.getUsbCameraInfo(m_handle);
}
diff --git a/cscore/src/main/java/edu/wpi/first/cscore/VideoCamera.java b/cscore/src/main/java/edu/wpi/first/cscore/VideoCamera.java
index ca3b09e642..23cf7d6e98 100644
--- a/cscore/src/main/java/edu/wpi/first/cscore/VideoCamera.java
+++ b/cscore/src/main/java/edu/wpi/first/cscore/VideoCamera.java
@@ -18,12 +18,20 @@ public class VideoCamera extends VideoSource {
super(handle);
}
- /** Set the brightness, as a percentage (0-100). */
+ /**
+ * Set the brightness, as a percentage (0-100).
+ *
+ * @param brightness Brightness as a percentage (0-100).
+ */
public synchronized void setBrightness(int brightness) {
CameraServerJNI.setCameraBrightness(m_handle, brightness);
}
- /** Get the brightness, as a percentage (0-100). */
+ /**
+ * Get the brightness, as a percentage (0-100).
+ *
+ * @return The brightness as a percentage (0-100).
+ */
public synchronized int getBrightness() {
return CameraServerJNI.getCameraBrightness(m_handle);
}
@@ -38,7 +46,11 @@ public class VideoCamera extends VideoSource {
CameraServerJNI.setCameraWhiteBalanceHoldCurrent(m_handle);
}
- /** Set the white balance to manual, with specified color temperature. */
+ /**
+ * Set the white balance to manual, with specified color temperature.
+ *
+ * @param value The specified color temperature.
+ */
public synchronized void setWhiteBalanceManual(int value) {
CameraServerJNI.setCameraWhiteBalanceManual(m_handle, value);
}
@@ -53,7 +65,11 @@ public class VideoCamera extends VideoSource {
CameraServerJNI.setCameraExposureHoldCurrent(m_handle);
}
- /** Set the exposure to manual, as a percentage (0-100). */
+ /**
+ * Set the exposure to manual, as a percentage (0-100).
+ *
+ * @param value The exposure as a percentage (0-100).
+ */
public synchronized void setExposureManual(int value) {
CameraServerJNI.setCameraExposureManual(m_handle, value);
}
diff --git a/cscore/src/main/java/edu/wpi/first/cscore/VideoMode.java b/cscore/src/main/java/edu/wpi/first/cscore/VideoMode.java
index af7fb8f1cb..726b2106aa 100644
--- a/cscore/src/main/java/edu/wpi/first/cscore/VideoMode.java
+++ b/cscore/src/main/java/edu/wpi/first/cscore/VideoMode.java
@@ -31,7 +31,14 @@ public class VideoMode {
return m_pixelFormatValues[pixelFormat];
}
- /** Create a new video mode. */
+ /**
+ * Create a new video mode.
+ *
+ * @param pixelFormat The pixel format enum as an integer.
+ * @param width The image width in pixels.
+ * @param height The image height in pixels.
+ * @param fps The camera's frames per second.
+ */
public VideoMode(int pixelFormat, int width, int height, int fps) {
this.pixelFormat = getPixelFormatFromInt(pixelFormat);
this.width = width;
@@ -39,7 +46,14 @@ public class VideoMode {
this.fps = fps;
}
- /** Create a new video mode. */
+ /**
+ * Create a new video mode.
+ *
+ * @param pixelFormat The pixel format.
+ * @param width The image width in pixels.
+ * @param height The image height in pixels.
+ * @param fps The camera's frames per second.
+ */
public VideoMode(PixelFormat pixelFormat, int width, int height, int fps) {
this.pixelFormat = pixelFormat;
this.width = width;
diff --git a/cscore/src/main/java/edu/wpi/first/cscore/VideoSink.java b/cscore/src/main/java/edu/wpi/first/cscore/VideoSink.java
index 4d670c8d53..8b07f4634f 100644
--- a/cscore/src/main/java/edu/wpi/first/cscore/VideoSink.java
+++ b/cscore/src/main/java/edu/wpi/first/cscore/VideoSink.java
@@ -83,7 +83,11 @@ public class VideoSink implements AutoCloseable {
return m_handle;
}
- /** Get the kind of the sink. */
+ /**
+ * Get the kind of the sink.
+ *
+ * @return The kind of the sink.
+ */
public Kind getKind() {
return getKindFromInt(CameraServerJNI.getSinkKind(m_handle));
}
@@ -91,12 +95,18 @@ public class VideoSink implements AutoCloseable {
/**
* Get the name of the sink. The name is an arbitrary identifier provided when the sink is
* created, and should be unique.
+ *
+ * @return The name of the sink.
*/
public String getName() {
return CameraServerJNI.getSinkName(m_handle);
}
- /** Get the sink description. This is sink-kind specific. */
+ /**
+ * Get the sink description. This is sink-kind specific.
+ *
+ * @return The sink description.
+ */
public String getDescription() {
return CameraServerJNI.getSinkDescription(m_handle);
}
@@ -111,7 +121,11 @@ public class VideoSink implements AutoCloseable {
return new VideoProperty(CameraServerJNI.getSinkProperty(m_handle, name));
}
- /** Enumerate all properties of this sink. */
+ /**
+ * Enumerate all properties of this sink.
+ *
+ * @return List of properties.
+ */
public VideoProperty[] enumerateProperties() {
int[] handles = CameraServerJNI.enumerateSinkProperties(m_handle);
VideoProperty[] rv = new VideoProperty[handles.length];
diff --git a/cscore/src/main/java/edu/wpi/first/cscore/VideoSource.java b/cscore/src/main/java/edu/wpi/first/cscore/VideoSource.java
index 41f103c1db..0ae5adddc6 100644
--- a/cscore/src/main/java/edu/wpi/first/cscore/VideoSource.java
+++ b/cscore/src/main/java/edu/wpi/first/cscore/VideoSource.java
@@ -113,7 +113,11 @@ public class VideoSource implements AutoCloseable {
return m_handle;
}
- /** Get the kind of the source. */
+ /**
+ * Get the kind of the source.
+ *
+ * @return The kind of the source.
+ */
public Kind getKind() {
return getKindFromInt(CameraServerJNI.getSourceKind(m_handle));
}
@@ -121,12 +125,18 @@ public class VideoSource implements AutoCloseable {
/**
* Get the name of the source. The name is an arbitrary identifier provided when the source is
* created, and should be unique.
+ *
+ * @return The name of the source.
*/
public String getName() {
return CameraServerJNI.getSourceName(m_handle);
}
- /** Get the source description. This is source-kind specific. */
+ /**
+ * Get the source description. This is source-kind specific.
+ *
+ * @return The source description.
+ */
public String getDescription() {
return CameraServerJNI.getSourceDescription(m_handle);
}
@@ -153,7 +163,11 @@ public class VideoSource implements AutoCloseable {
CameraServerJNI.setSourceConnectionStrategy(m_handle, strategy.getValue());
}
- /** Returns if the source currently connected to whatever is providing the images. */
+ /**
+ * Returns true if the source currently connected to whatever is providing the images.
+ *
+ * @return True if the source currently connected to whatever is providing the images.
+ */
public boolean isConnected() {
return CameraServerJNI.isSourceConnected(m_handle);
}
@@ -178,7 +192,11 @@ public class VideoSource implements AutoCloseable {
return new VideoProperty(CameraServerJNI.getSourceProperty(m_handle, name));
}
- /** Enumerate all properties of this source. */
+ /**
+ * Enumerate all properties of this source.
+ *
+ * @return Array of video properties.
+ */
public VideoProperty[] enumerateProperties() {
int[] handles = CameraServerJNI.enumerateSourceProperties(m_handle);
VideoProperty[] rv = new VideoProperty[handles.length];
@@ -188,7 +206,11 @@ public class VideoSource implements AutoCloseable {
return rv;
}
- /** Get the current video mode. */
+ /**
+ * Get the current video mode.
+ *
+ * @return The current video mode.
+ */
public VideoMode getVideoMode() {
return CameraServerJNI.getSourceVideoMode(m_handle);
}
@@ -197,6 +219,7 @@ public class VideoSource implements AutoCloseable {
* Set the video mode.
*
* @param mode Video mode
+ * @return True if set successfully.
*/
public boolean setVideoMode(VideoMode mode) {
return CameraServerJNI.setSourceVideoMode(
@@ -312,7 +335,11 @@ public class VideoSource implements AutoCloseable {
m_handle, CameraServerJNI.TelemetryKind.kSourceBytesReceived);
}
- /** Enumerate all known video modes for this source. */
+ /**
+ * Enumerate all known video modes for this source.
+ *
+ * @return Vector of video modes.
+ */
public VideoMode[] enumerateVideoModes() {
return CameraServerJNI.enumerateSourceVideoModes(m_handle);
}
diff --git a/cscore/src/main/java/edu/wpi/first/cscore/raw/RawFrame.java b/cscore/src/main/java/edu/wpi/first/cscore/raw/RawFrame.java
index 1919d6b2dd..5f62481c86 100644
--- a/cscore/src/main/java/edu/wpi/first/cscore/raw/RawFrame.java
+++ b/cscore/src/main/java/edu/wpi/first/cscore/raw/RawFrame.java
@@ -35,7 +35,16 @@ public class RawFrame implements AutoCloseable {
CameraServerJNI.freeRawFrame(m_framePtr);
}
- /** Called from JNI to set data in class. */
+ /**
+ * Called from JNI to set data in class.
+ *
+ * @param dataByteBuffer A ByteBuffer pointing to the frame data.
+ * @param dataPtr A long (a char* in native code) pointing to the frame data.
+ * @param totalData The total length of the data stored in the frame.
+ * @param width The width of the frame.
+ * @param height The height of the frame.
+ * @param pixelFormat The PixelFormat of the frame.
+ */
public void setData(
ByteBuffer dataByteBuffer,
long dataPtr,
@@ -51,7 +60,11 @@ public class RawFrame implements AutoCloseable {
m_pixelFormat = pixelFormat;
}
- /** Get the pointer to native representation of this frame. */
+ /**
+ * Get the pointer to native representation of this frame.
+ *
+ * @return The pointer to native representation of this frame.
+ */
public long getFramePtr() {
return m_framePtr;
}
@@ -60,6 +73,8 @@ public class RawFrame implements AutoCloseable {
* Get a ByteBuffer pointing to the frame data. This ByteBuffer is backed by the frame directly.
* Its lifetime is controlled by the frame. If a new frame gets read, it will overwrite the
* current one.
+ *
+ * @return A ByteBuffer pointing to the frame data.
*/
public ByteBuffer getDataByteBuffer() {
return m_dataByteBuffer;
@@ -69,42 +84,72 @@ public class RawFrame implements AutoCloseable {
* Get a long (is a char* in native code) pointing to the frame data. This pointer is backed by
* the frame directly. Its lifetime is controlled by the frame. If a new frame gets read, it will
* overwrite the current one.
+ *
+ * @return A long pointing to the frame data.
*/
public long getDataPtr() {
return m_dataPtr;
}
- /** Get the total length of the data stored in the frame. */
+ /**
+ * Get the total length of the data stored in the frame.
+ *
+ * @return The total length of the data stored in the frame.
+ */
public int getTotalData() {
return m_totalData;
}
- /** Get the width of the frame. */
+ /**
+ * Get the width of the frame.
+ *
+ * @return The width of the frame.
+ */
public int getWidth() {
return m_width;
}
- /** Set the width of the frame. */
+ /**
+ * Set the width of the frame.
+ *
+ * @param width The width of the frame.
+ */
public void setWidth(int width) {
this.m_width = width;
}
- /** Get the height of the frame. */
+ /**
+ * Get the height of the frame.
+ *
+ * @return The height of the frame.
+ */
public int getHeight() {
return m_height;
}
- /** Set the height of the frame. */
+ /**
+ * Set the height of the frame.
+ *
+ * @param height The height of the frame.
+ */
public void setHeight(int height) {
this.m_height = height;
}
- /** Get the PixelFormat of the frame. */
+ /**
+ * Get the PixelFormat of the frame.
+ *
+ * @return The PixelFormat of the frame.
+ */
public int getPixelFormat() {
return m_pixelFormat;
}
- /** Set the PixelFormat of the frame. */
+ /**
+ * Set the PixelFormat of the frame.
+ *
+ * @param pixelFormat The PixelFormat of the frame.
+ */
public void setPixelFormat(int pixelFormat) {
this.m_pixelFormat = pixelFormat;
}
diff --git a/cscore/src/main/java/edu/wpi/first/cscore/raw/RawSink.java b/cscore/src/main/java/edu/wpi/first/cscore/raw/RawSink.java
index 64afae2b64..ae5b0ef94c 100644
--- a/cscore/src/main/java/edu/wpi/first/cscore/raw/RawSink.java
+++ b/cscore/src/main/java/edu/wpi/first/cscore/raw/RawSink.java
@@ -28,6 +28,7 @@ public class RawSink extends ImageSink {
* Wait for the next frame and get the image. Times out (returning 0) after 0.225 seconds. The
* provided image will have three 8-bit channels stored in BGR order.
*
+ * @param frame The frame object in which to store the image.
* @return Frame time, or 0 on error (call getError() to obtain the error message); the frame time
* is in the same time base as wpi::Now(), and is in 1 us increments.
*/
@@ -39,6 +40,8 @@ public class RawSink extends ImageSink {
* Wait for the next frame and get the image. Times out (returning 0) after timeout seconds. The
* provided image will have three 8-bit channels stored in BGR order.
*
+ * @param frame The frame object in which to store the image.
+ * @param timeout The frame timeout in seconds.
* @return Frame time, or 0 on error (call getError() to obtain the error message); the frame time
* is in the same time base as wpi::Now(), and is in 1 us increments.
*/
@@ -50,6 +53,7 @@ public class RawSink extends ImageSink {
* Wait for the next frame and get the image. May block forever. The provided image will have
* three 8-bit channels stored in BGR order.
*
+ * @param frame The frame object in which to store the image.
* @return Frame time, or 0 on error (call getError() to obtain the error message); the frame time
* is in the same time base as wpi::Now(), and is in 1 us increments.
*/
diff --git a/docs/build.gradle b/docs/build.gradle
index dad46dd1dd..d800786e8c 100644
--- a/docs/build.gradle
+++ b/docs/build.gradle
@@ -68,10 +68,6 @@ doxygen {
recursive true
quiet true
warnings false
- warn_if_doc_error false
- warn_no_paramdoc false
- warn_format false
- warn_logfile false
warn_if_undocumented false
generate_latex false
use_mathjax true
diff --git a/hal/src/main/java/edu/wpi/first/hal/AccumulatorResult.java b/hal/src/main/java/edu/wpi/first/hal/AccumulatorResult.java
index 64d017671c..9340748f08 100644
--- a/hal/src/main/java/edu/wpi/first/hal/AccumulatorResult.java
+++ b/hal/src/main/java/edu/wpi/first/hal/AccumulatorResult.java
@@ -13,7 +13,12 @@ public class AccumulatorResult {
@SuppressWarnings("MemberName")
public long count;
- /** Set the value and count. */
+ /**
+ * Set the value and count.
+ *
+ * @param value The total value accumulated.
+ * @param count The number of samples accumulated.
+ */
public void set(long value, long count) {
this.value = value;
this.count = count;
diff --git a/hal/src/main/java/edu/wpi/first/hal/CANData.java b/hal/src/main/java/edu/wpi/first/hal/CANData.java
index b37c2bdd59..94e9f573c4 100644
--- a/hal/src/main/java/edu/wpi/first/hal/CANData.java
+++ b/hal/src/main/java/edu/wpi/first/hal/CANData.java
@@ -14,7 +14,13 @@ public class CANData {
@SuppressWarnings("MemberName")
public long timestamp;
- /** API used from JNI to set the data. */
+ /**
+ * API used from JNI to set the data.
+ *
+ * @param length Length of packet in bytes.
+ * @param timestamp CAN frame timestamp in microseconds.
+ * @return Buffer containing CAN frame.
+ */
@SuppressWarnings("PMD.MethodReturnsInternalArray")
public byte[] setData(int length, long timestamp) {
this.length = length;
diff --git a/hal/src/main/java/edu/wpi/first/hal/HAL.java b/hal/src/main/java/edu/wpi/first/hal/HAL.java
index 6fd6910aab..af97450337 100644
--- a/hal/src/main/java/edu/wpi/first/hal/HAL.java
+++ b/hal/src/main/java/edu/wpi/first/hal/HAL.java
@@ -136,17 +136,18 @@ public final class HAL extends JNIWrapper {
}
/**
- * Report the usage of a resource of interest.
+ * Report the usage of a resource of interest.
*
*
Original signature: uint32_t report(tResourceType, uint8_t, uint8_t, const
* char*)
*
- * @param resource one of the values in the tResourceType above (max value 51).
- * @param instanceNumber an index that identifies the resource instance.
+ * @param resource one of the values in the tResourceType above (max value 51).
+ * @param instanceNumber an index that identifies the resource instance.
* @param context an optional additional context number for some cases (such as module number).
- * Set to 0 to omit.
+ * Set to 0 to omit.
* @param feature a string to be included describing features in use on a specific resource.
* Setting the same resource more than once allows you to change the feature string.
+ * @return TODO
*/
public static native int report(int resource, int instanceNumber, int context, String feature);
diff --git a/hal/src/main/java/edu/wpi/first/hal/JNIWrapper.java b/hal/src/main/java/edu/wpi/first/hal/JNIWrapper.java
index 0b46737e42..a524b7905b 100644
--- a/hal/src/main/java/edu/wpi/first/hal/JNIWrapper.java
+++ b/hal/src/main/java/edu/wpi/first/hal/JNIWrapper.java
@@ -40,7 +40,11 @@ public class JNIWrapper {
}
}
- /** Force load the library. */
+ /**
+ * Force load the library.
+ *
+ * @throws IOException if the library load failed
+ */
public static synchronized void forceLoad() throws IOException {
if (libraryLoaded) {
return;
diff --git a/hal/src/main/java/edu/wpi/first/hal/MatchInfoData.java b/hal/src/main/java/edu/wpi/first/hal/MatchInfoData.java
index f1dae884e8..6737c581d6 100644
--- a/hal/src/main/java/edu/wpi/first/hal/MatchInfoData.java
+++ b/hal/src/main/java/edu/wpi/first/hal/MatchInfoData.java
@@ -26,7 +26,15 @@ public class MatchInfoData {
@SuppressWarnings("MemberName")
public int matchType;
- /** Called from JNI to set the structure data. */
+ /**
+ * Called from JNI to set the structure data.
+ *
+ * @param eventName Event name.
+ * @param gameSpecificMessage Game-specific message.
+ * @param matchNumber Match number.
+ * @param replayNumber Replay number.
+ * @param matchType Match type.
+ */
@SuppressWarnings("MissingJavadocMethod")
public void setData(
String eventName,
diff --git a/hal/src/main/java/edu/wpi/first/hal/NotifierJNI.java b/hal/src/main/java/edu/wpi/first/hal/NotifierJNI.java
index 25628d6ab0..c8f4eef98c 100644
--- a/hal/src/main/java/edu/wpi/first/hal/NotifierJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/NotifierJNI.java
@@ -11,33 +11,65 @@ package edu.wpi.first.hal;
* class, which corresponds to the C++ Notifier class, should be used.
*/
public class NotifierJNI extends JNIWrapper {
- /** Initializes the notifier. */
+ /**
+ * Initializes the notifier.
+ *
+ * @return True on success.
+ */
public static native int initializeNotifier();
- /** Sets the HAL notifier thread priority. */
+ /**
+ * Sets the HAL notifier thread priority.
+ *
+ * @param realTime Set to true to set a real-time priority, false for standard priority.
+ * @param priority Priority to set the thread to. For real-time, this is 1-99 with 99 being
+ * highest. For non-real-time, this is forced to 0. See "man 7 sched" for more details.
+ * @return True on success.
+ */
public static native boolean setHALThreadPriority(boolean realTime, int priority);
- /** Sets the name of the notifier. */
+ /**
+ * Sets the name of the notifier.
+ *
+ * @param notifierHandle Notifier handle.
+ * @param name Notifier name.
+ */
public static native void setNotifierName(int notifierHandle, String name);
/**
* Wakes up the waiter with time=0. Note: after this function is called, all calls to
* waitForNotifierAlarm() will immediately start returning 0.
+ *
+ * @param notifierHandle Notifier handle.
*/
public static native void stopNotifier(int notifierHandle);
- /** Deletes the notifier object when we are done with it. */
+ /**
+ * Deletes the notifier object when we are done with it.
+ *
+ * @param notifierHandle Notifier handle.
+ */
public static native void cleanNotifier(int notifierHandle);
- /** Sets the notifier to wakeup the waiter in another triggerTime microseconds. */
+ /**
+ * Sets the notifier to wakeup the waiter in another triggerTime microseconds.
+ *
+ * @param notifierHandle Notifier handle.
+ * @param triggerTime Trigger time in microseconds.
+ */
public static native void updateNotifierAlarm(int notifierHandle, long triggerTime);
- /** Cancels any pending wakeups set by updateNotifierAlarm(). Does NOT wake up any waiters. */
+ /**
+ * Cancels any pending wakeups set by updateNotifierAlarm(). Does NOT wake up any waiters.
+ *
+ * @param notifierHandle Notifier handle.
+ */
public static native void cancelNotifierAlarm(int notifierHandle);
/**
* Block until woken up by an alarm (or stop).
*
+ * @param notifierHandle Notifier handle.
* @return Time when woken up.
*/
public static native long waitForNotifierAlarm(int notifierHandle);
diff --git a/hal/src/main/java/edu/wpi/first/hal/simulation/SimDeviceDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/SimDeviceDataJNI.java
index 33c1bac477..ef6536a8c9 100644
--- a/hal/src/main/java/edu/wpi/first/hal/simulation/SimDeviceDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/SimDeviceDataJNI.java
@@ -61,6 +61,7 @@ public class SimDeviceDataJNI extends JNIWrapper {
* @param handle simulated value handle
* @param callback callback
* @param initialNotify ignored (present for consistency)
+ * @return TODO
*/
public static native int registerSimValueResetCallback(
int handle, SimValueCallback callback, boolean initialNotify);
diff --git a/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTable.java b/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTable.java
index 24b2c094b7..7837a21eba 100644
--- a/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTable.java
+++ b/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTable.java
@@ -366,7 +366,11 @@ public final class NetworkTable {
return getEntry(key).getValue();
}
- /** Get the path of the NetworkTable. */
+ /**
+ * Get the path of the NetworkTable.
+ *
+ * @return The path of the NetworkTable.
+ */
public String getPath() {
return m_path;
}
diff --git a/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTablesJNI.java b/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTablesJNI.java
index 4e1da98577..74b244e69b 100644
--- a/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTablesJNI.java
+++ b/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTablesJNI.java
@@ -40,7 +40,11 @@ public final class NetworkTablesJNI {
}
}
- /** Force load the library. */
+ /**
+ * Force load the library.
+ *
+ * @throws IOException if the library fails to load
+ */
public static synchronized void forceLoad() throws IOException {
if (libraryLoaded) {
return;
diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/Button.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/Button.java
index 4185c278b2..0f8594d9f4 100644
--- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/Button.java
+++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/Button.java
@@ -177,6 +177,7 @@ public class Button extends Trigger {
*
* @param command the command to start
* @param interruptible whether the command is interruptible
+ * @return this button, so calls can be chained
*/
public Button toggleWhenPressed(final Command command, boolean interruptible) {
toggleWhenActive(command, interruptible);
diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/Command.h b/wpilibNewCommands/src/main/native/include/frc2/command/Command.h
index b2ff4d9a26..e9b5e4afde 100644
--- a/wpilibNewCommands/src/main/native/include/frc2/command/Command.h
+++ b/wpilibNewCommands/src/main/native/include/frc2/command/Command.h
@@ -173,8 +173,8 @@ class Command {
PerpetualCommand Perpetually() &&;
/**
- * Decorates this command to run "by proxy" by wrapping it in a {@link
- * ProxyScheduleCommand}. This is useful for "forking off" from command groups
+ * Decorates this command to run "by proxy" by wrapping it in a
+ * ProxyScheduleCommand. This is useful for "forking off" from command groups
* when the user does not wish to extend the command's requirements to the
* entire command group.
*
diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/MecanumControllerCommand.h b/wpilibNewCommands/src/main/native/include/frc2/command/MecanumControllerCommand.h
index 90d3033a32..29f0fd4203 100644
--- a/wpilibNewCommands/src/main/native/include/frc2/command/MecanumControllerCommand.h
+++ b/wpilibNewCommands/src/main/native/include/frc2/command/MecanumControllerCommand.h
@@ -30,9 +30,9 @@
namespace frc2 {
/**
- * A command that uses two PID controllers ({@link PIDController}) and a
- * ProfiledPIDController ({@link ProfiledPIDController}) to follow a trajectory
- * {@link Trajectory} with a mecanum drive.
+ * A command that uses two PID controllers (PIDController) and a profiled PID
+ * controller (ProfiledPIDController) to follow a trajectory (Trajectory) with a
+ * mecanum drive.
*
*
The command handles trajectory-following, * Velocity PID calculations, and feedforwards internally. This diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/SwerveControllerCommand.h b/wpilibNewCommands/src/main/native/include/frc2/command/SwerveControllerCommand.h index 13733fe6b1..9620fef1f3 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/SwerveControllerCommand.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/SwerveControllerCommand.h @@ -29,9 +29,9 @@ namespace frc2 { /** - * A command that uses two PID controllers ({@link PIDController}) and a - * ProfiledPIDController ({@link ProfiledPIDController}) to follow a trajectory - * {@link Trajectory} with a swerve drive. + * A command that uses two PID controllers (PIDController) and a profiled PID + * controller (ProfiledPIDController) to follow a trajectory (Trajectory) with a + * swerve drive. * *
The command handles trajectory-following, Velocity PID calculations, and
* feedforwards internally. This is intended to be a more-or-less "complete
diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/button/NetworkButton.h b/wpilibNewCommands/src/main/native/include/frc2/command/button/NetworkButton.h
index a33702c621..191e55d8c1 100644
--- a/wpilibNewCommands/src/main/native/include/frc2/command/button/NetworkButton.h
+++ b/wpilibNewCommands/src/main/native/include/frc2/command/button/NetworkButton.h
@@ -14,7 +14,7 @@
namespace frc2 {
/**
- * A {@link Button} that uses a {@link NetworkTable} boolean field.
+ * A Button that uses a NetworkTable boolean field.
*/
class NetworkButton : public Button {
public:
diff --git a/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/PIDBase.java b/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/PIDBase.java
index 1f8247e45c..d970451178 100644
--- a/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/PIDBase.java
+++ b/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/PIDBase.java
@@ -307,6 +307,8 @@ public class PIDBase implements PIDInterface, PIDOutput, Sendable, AutoCloseable
* setpoint for the output. If a position PID controller is being used, the F term should be set
* to 1 over the maximum speed for the output measured in setpoint units per this controller's
* update period (see the default period in this class's constructor).
+ *
+ * @return The feedforward value.
*/
protected double calculateFeedForward() {
if (m_pidInput.getPIDSourceType().equals(PIDSourceType.kRate)) {
diff --git a/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/PIDController.java b/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/PIDController.java
index 505ab6962e..ad7046e6a4 100644
--- a/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/PIDController.java
+++ b/wpilibOldCommands/src/main/java/edu/wpi/first/wpilibj/PIDController.java
@@ -137,7 +137,11 @@ public class PIDController extends PIDBase implements Controller {
}
}
- /** Set the enabled state of the PIDController. */
+ /**
+ * Set the enabled state of the PIDController.
+ *
+ * @param enable True to enable the PIDController.
+ */
public void setEnabled(boolean enable) {
if (enable) {
enable();
@@ -146,7 +150,11 @@ public class PIDController extends PIDBase implements Controller {
}
}
- /** Return true if PIDController is enabled. */
+ /**
+ * Return true if PIDController is enabled.
+ *
+ * @return True if PIDController is enabled.
+ */
public boolean isEnabled() {
m_thisMutex.lock();
try {
diff --git a/wpilibc/src/main/native/include/frc/smartdashboard/SmartDashboard.h b/wpilibc/src/main/native/include/frc/smartdashboard/SmartDashboard.h
index c15b26a783..ef3830b38f 100644
--- a/wpilibc/src/main/native/include/frc/smartdashboard/SmartDashboard.h
+++ b/wpilibc/src/main/native/include/frc/smartdashboard/SmartDashboard.h
@@ -422,8 +422,7 @@ class SmartDashboard : public Sendable, public SendableHelper This center value is based on the output of the oversampled and averaged source the
* accumulator channel. Because of this, any non-zero oversample bits will affect the size of the
* value for this field.
+ *
+ * @param center The accumulator's center value.
*/
public void setAccumulatorCenter(int center) {
AnalogJNI.setAccumulatorCenter(m_port, center);
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogOutput.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogOutput.java
index 908aea64e0..cab2d794fa 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogOutput.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogOutput.java
@@ -39,7 +39,11 @@ public class AnalogOutput implements Sendable, AutoCloseable {
m_channel = 0;
}
- /** Get the channel of this AnalogOutput. */
+ /**
+ * Get the channel of this AnalogOutput.
+ *
+ * @return The channel of this AnalogOutput.
+ */
public int getChannel() {
return m_channel;
}
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/CAN.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/CAN.java
index 032647ce84..3dc6c1d79e 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/CAN.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/CAN.java
@@ -96,6 +96,7 @@ public class CAN implements Closeable {
*
* @param data The data to write (8 bytes max)
* @param apiId The API ID to write.
+ * @return TODO
*/
public int writePacketNoThrow(byte[] data, int apiId) {
return CANAPIJNI.writeCANPacketNoThrow(m_handle, data, apiId);
@@ -108,6 +109,7 @@ public class CAN implements Closeable {
* @param data The data to write (8 bytes max)
* @param apiId The API ID to write.
* @param repeatMs The period to repeat the packet at.
+ * @return TODO
*/
public int writePacketRepeatingNoThrow(byte[] data, int apiId, int repeatMs) {
return CANAPIJNI.writeCANPacketRepeatingNoThrow(m_handle, data, apiId, repeatMs);
@@ -119,6 +121,7 @@ public class CAN implements Closeable {
*
* @param length The length to request (0 to 8)
* @param apiId The API ID to write.
+ * @return TODO
*/
public int writeRTRFrameNoThrow(int length, int apiId) {
return CANAPIJNI.writeCANRTRFrameNoThrow(m_handle, length, apiId);
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Counter.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Counter.java
index 5ed499497a..d6ef798ba1 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Counter.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Counter.java
@@ -53,7 +53,11 @@ public class Counter implements CounterBase, Sendable, AutoCloseable {
private int m_index; // /< The index of this counter.
private double m_distancePerPulse; // distance of travel for each tick
- /** Create an instance of a counter with the given mode. */
+ /**
+ * Create an instance of a counter with the given mode.
+ *
+ * @param mode The counter mode.
+ */
public Counter(final Mode mode) {
ByteBuffer index = ByteBuffer.allocateDirect(4);
// set the byte order
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java
index 96351cf27a..b714a3ce1b 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java
@@ -343,6 +343,7 @@ public class DriverStation {
/**
* Report error to Driver Station. Optionally appends Stack trace to error message.
*
+ * @param error The error to report.
* @param printTrace If true, append stack trace to error string
*/
public static void reportError(String error, boolean printTrace) {
@@ -352,6 +353,7 @@ public class DriverStation {
/**
* Report error to Driver Station. Appends provided stack trace to error message.
*
+ * @param error The error to report.
* @param stackTrace The stack trace to append
*/
public static void reportError(String error, StackTraceElement[] stackTrace) {
@@ -361,19 +363,21 @@ public class DriverStation {
/**
* Report warning to Driver Station. Optionally appends Stack trace to warning message.
*
+ * @param warning The warning to report.
* @param printTrace If true, append stack trace to warning string
*/
- public static void reportWarning(String error, boolean printTrace) {
- reportErrorImpl(false, 1, error, printTrace);
+ public static void reportWarning(String warning, boolean printTrace) {
+ reportErrorImpl(false, 1, warning, printTrace);
}
/**
* Report warning to Driver Station. Appends provided stack trace to warning message.
*
+ * @param warning The warning to report.
* @param stackTrace The stack trace to append
*/
- public static void reportWarning(String error, StackTraceElement[] stackTrace) {
- reportErrorImpl(false, 1, error, stackTrace);
+ public static void reportWarning(String warning, StackTraceElement[] stackTrace) {
+ reportErrorImpl(false, 1, warning, stackTrace);
}
private static void reportErrorImpl(boolean isError, int code, String error, boolean printTrace) {
@@ -565,6 +569,8 @@ public class DriverStation {
/**
* Get the state of a POV on the joystick.
*
+ * @param stick The joystick to read.
+ * @param pov The POV to read.
* @return the angle of the POV in degrees, or -1 if the POV is not pressed.
*/
public int getStickPOV(int stick, int pov) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/GenericHID.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/GenericHID.java
index 9bd871d57b..340c3fb92e 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/GenericHID.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/GenericHID.java
@@ -192,12 +192,20 @@ public abstract class GenericHID {
return m_ds.getStickAxisCount(m_port);
}
- /** For the current HID, return the number of POVs. */
+ /**
+ * For the current HID, return the number of POVs.
+ *
+ * @return the number of POVs for the current HID
+ */
public int getPOVCount() {
return m_ds.getStickPOVCount(m_port);
}
- /** For the current HID, return the number of buttons. */
+ /**
+ * For the current HID, return the number of buttons.
+ *
+ * @return the number of buttons for the current HID
+ */
public int getButtonCount() {
return m_ds.getStickButtonCount(m_port);
}
@@ -232,6 +240,7 @@ public abstract class GenericHID {
/**
* Get the axis type of a joystick axis.
*
+ * @param axis The axis to read, starting at 0.
* @return the axis type of a joystick axis.
*/
public int getAxisType(int axis) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobotBase.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobotBase.java
index 25ecb54f68..ca99053e87 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobotBase.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobotBase.java
@@ -203,7 +203,11 @@ public abstract class IterativeRobotBase extends RobotBase {
m_ntFlushEnabled = enabled;
}
- /** Gets time period between calls to Periodic() functions. */
+ /**
+ * Gets time period between calls to Periodic() functions.
+ *
+ * @return The time period between calls to Periodic() functions.
+ */
public double getPeriod() {
return m_period;
}
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWM.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWM.java
index df1db7ded4..43393ee613 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWM.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWM.java
@@ -117,6 +117,8 @@ public class PWM implements Sendable, AutoCloseable {
* Gets the bounds on the PWM pulse widths. This Gets the bounds on the PWM values for a
* particular type of controller. The values determine the upper and lower speeds as well as the
* deadband bracket.
+ *
+ * @return The bounds on the PWM pulse widths.
*/
public PWMConfigDataResult getRawBounds() {
return PWMJNI.getPWMConfigRaw(m_handle);
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/PowerDistributionPanel.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/PowerDistributionPanel.java
index eed3e0550e..c8f70e69a9 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/PowerDistributionPanel.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/PowerDistributionPanel.java
@@ -67,6 +67,7 @@ public class PowerDistributionPanel implements Sendable, AutoCloseable {
/**
* Query the current of a single channel of the PDP.
*
+ * @param channel The PDP channel to query.
* @return The current of one of the PDP channels (channels 0-15) in Amperes
*/
public double getCurrent(int channel) {
@@ -114,7 +115,11 @@ public class PowerDistributionPanel implements Sendable, AutoCloseable {
PDPJNI.clearPDPStickyFaults(m_handle);
}
- /** Gets module number (CAN ID). */
+ /**
+ * Gets module number (CAN ID).
+ *
+ * @return The module number (CAN ID).
+ */
public int getModule() {
return m_module;
}
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java
index d68eb00a8a..dd941983af 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java
@@ -357,14 +357,23 @@ public abstract class RobotBase implements AutoCloseable {
}
}
- /** Suppress the "Robots should not quit" message. */
+ /**
+ * Suppress the "Robots should not quit" message.
+ *
+ * @param value True if exit warning should be suppressed.
+ */
public static void suppressExitWarning(boolean value) {
m_runMutex.lock();
m_suppressExitWarning = value;
m_runMutex.unlock();
}
- /** Starting point for the applications. */
+ /**
+ * Starting point for the applications.
+ *
+ * @param If not running in output only mode, also saves the data received on the CIPO input during
* the transfer into the receive FIFO.
+ *
+ * @param dataToSend The buffer containing the data to send.
+ * @param size The number of bytes to send.
+ * @return Number of bytes written or -1 on error.
*/
public int write(byte[] dataToSend, int size) {
if (dataToSend.length < size) {
@@ -173,6 +177,8 @@ public class SPI implements AutoCloseable {
* the transfer into the receive FIFO.
*
* @param dataToSend The buffer containing the data to send.
+ * @param size The number of bytes to send.
+ * @return Number of bytes written or -1 on error.
*/
@SuppressWarnings("ByteBufferBackingArray")
public int write(ByteBuffer dataToSend, int size) {
@@ -198,6 +204,9 @@ public class SPI implements AutoCloseable {
* @param initiate If true, this function pushes "0" into the transmit buffer and initiates a
* transfer. If false, this function assumes that data is already in the receive FIFO from a
* previous write.
+ * @param dataReceived Buffer in which to store bytes read.
+ * @param size Number of bytes to read.
+ * @return Number of bytes read or -1 on error.
*/
public int read(boolean initiate, byte[] dataReceived, int size) {
if (dataReceived.length < size) {
@@ -218,6 +227,7 @@ public class SPI implements AutoCloseable {
* previous write.
* @param dataReceived The buffer to be filled with the received data.
* @param size The length of the transaction, in bytes
+ * @return Number of bytes read or -1 on error.
*/
@SuppressWarnings("ByteBufferBackingArray")
public int read(boolean initiate, ByteBuffer dataReceived, int size) {
@@ -239,6 +249,7 @@ public class SPI implements AutoCloseable {
* @param dataToSend The data to be written out to the device
* @param dataReceived Buffer to receive data from the device
* @param size The length of the transaction, in bytes
+ * @return TODO
*/
public int transaction(byte[] dataToSend, byte[] dataReceived, int size) {
if (dataToSend.length < size) {
@@ -256,6 +267,7 @@ public class SPI implements AutoCloseable {
* @param dataToSend The data to be written out to the device.
* @param dataReceived Buffer to receive data from the device.
* @param size The length of the transaction, in bytes
+ * @return TODO
*/
@SuppressWarnings("ByteBufferBackingArray")
public int transaction(ByteBuffer dataToSend, ByteBuffer dataReceived, int size) {
@@ -640,6 +652,8 @@ public class SPI implements AutoCloseable {
* The center value is subtracted from each value before it is added to the accumulator. This
* is used for the center value of devices like gyros and accelerometers to make integration work
* and to take the device offset into account when integrating.
+ *
+ * @param center The accumulator's center value.
*/
public void setAccumulatorCenter(int center) {
if (m_accum == null) {
@@ -650,7 +664,11 @@ public class SPI implements AutoCloseable {
}
}
- /** Set the accumulator's deadband. */
+ /**
+ * Set the accumulator's deadband.
+ *
+ * @param deadband The accumulator's deadband.
+ */
public void setAccumulatorDeadband(int deadband) {
if (m_accum == null) {
return;
@@ -660,7 +678,11 @@ public class SPI implements AutoCloseable {
}
}
- /** Read the last value read by the accumulator engine. */
+ /**
+ * Read the last value read by the accumulator engine.
+ *
+ * @return The last value read by the accumulator engine.
+ */
public int getAccumulatorLastValue() {
if (m_accum == null) {
return 0;
@@ -750,6 +772,8 @@ public class SPI implements AutoCloseable {
* The center value is subtracted from each value*dt before it is added to the integrated
* value. This is used for the center value of devices like gyros and accelerometers to take the
* device offset into account when integrating.
+ *
+ * @param center The accumulator integrator's center value.
*/
public void setAccumulatorIntegratedCenter(double center) {
if (m_accum == null) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SerialPort.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SerialPort.java
index b9a56d4ce9..331bbf1841 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SerialPort.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SerialPort.java
@@ -158,6 +158,7 @@ public class SerialPort implements AutoCloseable {
* Create an instance of a Serial Port class. Defaults to one stop bit.
*
* @param baudRate The baud rate to configure the serial port.
+ * @param port The serial port to use.
* @param dataBits The number of data bits per transfer. Valid values are between 5 and 8 bits.
* @param parity Select the type of parity checking to use.
*/
@@ -169,6 +170,7 @@ public class SerialPort implements AutoCloseable {
* Create an instance of a Serial Port class. Defaults to no parity and one stop bit.
*
* @param baudRate The baud rate to configure the serial port.
+ * @param port The serial port to use.
* @param dataBits The number of data bits per transfer. Valid values are between 5 and 8 bits.
*/
public SerialPort(final int baudRate, Port port, final int dataBits) {
@@ -179,6 +181,7 @@ public class SerialPort implements AutoCloseable {
* Create an instance of a Serial Port class. Defaults to 8 databits, no parity, and one stop bit.
*
* @param baudRate The baud rate to configure the serial port.
+ * @param port The serial port to use.
*/
public SerialPort(final int baudRate, Port port) {
this(baudRate, port, 8, Parity.kNone, StopBits.kOne);
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Solenoid.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Solenoid.java
index 5d03b56d5d..a6ee4725fa 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Solenoid.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Solenoid.java
@@ -77,7 +77,11 @@ public class Solenoid implements Sendable, AutoCloseable {
set(!get());
}
- /** Get the channel this solenoid is connected to. */
+ /**
+ * Get the channel this solenoid is connected to.
+ *
+ * @return The channel this solenoid is connected to.
+ */
public int getChannel() {
return m_channel;
}
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SpeedControllerGroup.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SpeedControllerGroup.java
index 6ae115ea6c..fe25a9db7c 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SpeedControllerGroup.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SpeedControllerGroup.java
@@ -24,6 +24,7 @@ public class SpeedControllerGroup implements MotorController, Sendable, AutoClos
/**
* Create a new SpeedControllerGroup with the provided SpeedControllers.
*
+ * @param speedController The first SpeedController to add.
* @param speedControllers The SpeedControllers to add
*/
public SpeedControllerGroup(
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SynchronousInterrupt.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SynchronousInterrupt.java
index 5033c609a9..0477e9ec52 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SynchronousInterrupt.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SynchronousInterrupt.java
@@ -35,7 +35,13 @@ public class SynchronousInterrupt implements AutoCloseable {
this.value = value;
}
- /** Create a wait result. */
+ /**
+ * Create a wait result.
+ *
+ * @param rising True if a rising edge occured.
+ * @param falling True if a falling edge occured.
+ * @return A wait result.
+ */
public static WaitResult getValue(boolean rising, boolean falling) {
if (rising && falling) {
return kBoth;
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Watchdog.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Watchdog.java
index 80dabd068d..ba11766242 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Watchdog.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Watchdog.java
@@ -81,7 +81,11 @@ public class Watchdog implements Closeable, Comparable This will return false until at least one input value has been computed.
+ *
+ * @return True if the error is within the tolerance of the error.
*/
public boolean atGoal() {
return atSetpoint() && m_goal.equals(m_setpoint);
@@ -191,6 +197,8 @@ public class ProfiledPIDController implements Sendable {
* Returns true if the error is within the tolerance of the error.
*
* This will return false until at least one input value has been computed.
+ *
+ * @return True if the error is within the tolerance of the error.
*/
public boolean atSetpoint() {
return m_controller.atSetpoint();
@@ -257,7 +265,11 @@ public class ProfiledPIDController implements Sendable {
return m_controller.getPositionError();
}
- /** Returns the change in error per second. */
+ /**
+ * Returns the change in error per second.
+ *
+ * @return The change in error per second.
+ */
public double getVelocityError() {
return m_controller.getVelocityError();
}
@@ -266,6 +278,7 @@ public class ProfiledPIDController implements Sendable {
* Returns the next output of the PID controller.
*
* @param measurement The current measurement of the process variable.
+ * @return The controller's next output.
*/
public double calculate(double measurement) {
if (m_controller.isContinuousInputEnabled()) {
@@ -294,6 +307,7 @@ public class ProfiledPIDController implements Sendable {
*
* @param measurement The current measurement of the process variable.
* @param goal The new goal of the controller.
+ * @return The controller's next output.
*/
public double calculate(double measurement, TrapezoidProfile.State goal) {
setGoal(goal);
@@ -305,6 +319,7 @@ public class ProfiledPIDController implements Sendable {
*
* @param measurement The current measurement of the process variable.
* @param goal The new goal of the controller.
+ * @return The controller's next output.
*/
public double calculate(double measurement, double goal) {
setGoal(goal);
@@ -317,6 +332,7 @@ public class ProfiledPIDController implements Sendable {
* @param measurement The current measurement of the process variable.
* @param goal The new goal of the controller.
* @param constraints Velocity and acceleration constraints for goal.
+ * @return The controller's next output.
*/
public double calculate(
double measurement, TrapezoidProfile.State goal, TrapezoidProfile.Constraints constraints) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/DifferentialDrive.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/DifferentialDrive.java
index 8dda71b2bd..a6b35e16b8 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/DifferentialDrive.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/DifferentialDrive.java
@@ -120,6 +120,9 @@ public class DifferentialDrive extends RobotDriveBase implements Sendable, AutoC
* To pass multiple motors per side, use a {@link
* edu.wpi.first.wpilibj.motorcontrol.MotorControllerGroup}. If a motor needs to be inverted, do
* so before passing it in.
+ *
+ * @param leftMotor Left motor.
+ * @param rightMotor Right motor.
*/
public DifferentialDrive(SpeedController leftMotor, SpeedController rightMotor) {
requireNonNull(leftMotor, "Left motor cannot be null");
@@ -256,6 +259,7 @@ public class DifferentialDrive extends RobotDriveBase implements Sendable, AutoC
* @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
* positive.
* @param squareInputs If set, decreases the input sensitivity at low speeds.
+ * @return Wheel speeds.
*/
@SuppressWarnings("ParameterName")
public static WheelSpeeds arcadeDriveIK(double xSpeed, double zRotation, boolean squareInputs) {
@@ -317,6 +321,7 @@ public class DifferentialDrive extends RobotDriveBase implements Sendable, AutoC
* positive.
* @param allowTurnInPlace If set, overrides constant-curvature turning for turn-in-place
* maneuvers.
+ * @return Wheel speeds.
*/
@SuppressWarnings("ParameterName")
public static WheelSpeeds curvatureDriveIK(
@@ -352,6 +357,7 @@ public class DifferentialDrive extends RobotDriveBase implements Sendable, AutoC
* @param rightSpeed The robot right side's speed along the X axis [-1.0..1.0]. Forward is
* positive.
* @param squareInputs If set, decreases the input sensitivity at low speeds.
+ * @return Wheel speeds.
*/
public static WheelSpeeds tankDriveIK(double leftSpeed, double rightSpeed, boolean squareInputs) {
leftSpeed = MathUtil.clamp(leftSpeed, -1.0, 1.0);
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/KilloughDrive.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/KilloughDrive.java
index b7f75fbd97..7536897521 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/KilloughDrive.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/KilloughDrive.java
@@ -240,6 +240,7 @@ public class KilloughDrive extends RobotDriveBase implements Sendable, AutoClose
* positive.
* @param gyroAngle The current angle reading from the gyro in degrees around the Z axis. Use this
* to implement field-oriented controls.
+ * @return Wheel speeds.
*/
@SuppressWarnings("ParameterName")
public WheelSpeeds driveCartesianIK(
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/MecanumDrive.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/MecanumDrive.java
index 8badfc3818..4b6b10355d 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/MecanumDrive.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/MecanumDrive.java
@@ -99,6 +99,11 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
* Construct a MecanumDrive.
*
* If a motor needs to be inverted, do so before passing it in.
+ *
+ * @param frontLeftMotor The motor on the front-left corner.
+ * @param rearLeftMotor The motor on the rear-left corner.
+ * @param frontRightMotor The motor on the front-right corner.
+ * @param rearRightMotor The motor on the rear-right corner.
*/
public MecanumDrive(
SpeedController frontLeftMotor,
@@ -214,6 +219,7 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
* positive.
* @param gyroAngle The current angle reading from the gyro in degrees around the Z axis. Use this
* to implement field-oriented controls.
+ * @return Wheel speeds.
*/
@SuppressWarnings("ParameterName")
public static WheelSpeeds driveCartesianIK(
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java
index b954143dcf..03ded74912 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java
@@ -82,6 +82,7 @@ public abstract class RobotDriveBase extends MotorSafety {
*
* @param value value to clip
* @param deadband range around zero
+ * @return The value after the deadband is applied.
*/
protected static double applyDeadband(double value, double deadband) {
if (Math.abs(value) > deadband) {
@@ -95,7 +96,11 @@ public abstract class RobotDriveBase extends MotorSafety {
}
}
- /** Normalize all wheel speeds if the magnitude of any wheel is greater than 1.0. */
+ /**
+ * Normalize all wheel speeds if the magnitude of any wheel is greater than 1.0.
+ *
+ * @param wheelSpeeds List of wheel speeds to normalize.
+ */
protected static void normalize(double[] wheelSpeeds) {
double maxMagnitude = Math.abs(wheelSpeeds[0]);
for (int i = 1; i < wheelSpeeds.length; i++) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/Vector2d.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/Vector2d.java
index 388bb0eee7..728cc833ea 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/Vector2d.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/Vector2d.java
@@ -38,12 +38,17 @@ public class Vector2d {
* Returns dot product of this vector with argument.
*
* @param vec Vector with which to perform dot product.
+ * @return Dot product of this vector with argument.
*/
public double dot(Vector2d vec) {
return x * vec.x + y * vec.y;
}
- /** Returns magnitude of vector. */
+ /**
+ * Returns magnitude of vector.
+ *
+ * @return Magnitude of vector.
+ */
public double magnitude() {
return Math.sqrt(x * x + y * y);
}
@@ -52,6 +57,7 @@ public class Vector2d {
* Returns scalar projection of this vector onto argument.
*
* @param vec Vector onto which to project this vector.
+ * @return scalar projection of this vector onto argument.
*/
public double scalarProject(Vector2d vec) {
return dot(vec) / vec.magnitude();
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/livewindow/LiveWindow.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/livewindow/LiveWindow.java
index cc1d8749ec..74129368c1 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/livewindow/LiveWindow.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/livewindow/LiveWindow.java
@@ -57,12 +57,17 @@ public class LiveWindow {
}
/**
- * Set the enabled state of LiveWindow. If it's being enabled, turn off the scheduler and remove
- * all the commands from the queue and enable all the components registered for LiveWindow. If
- * it's being disabled, stop all the registered components and reenable the scheduler. TODO: add
- * code to disable PID loops when enabling LiveWindow. The commands should reenable the PID loops
- * themselves when they get rescheduled. This prevents arms from starting to move around, etc.
- * after a period of adjusting them in LiveWindow mode.
+ * Set the enabled state of LiveWindow.
+ *
+ * If it's being enabled, turn off the scheduler and remove all the commands from the queue and
+ * enable all the components registered for LiveWindow. If it's being disabled, stop all the
+ * registered components and reenable the scheduler.
+ *
+ * TODO: add code to disable PID loops when enabling LiveWindow. The commands should reenable
+ * the PID loops themselves when they get rescheduled. This prevents arms from starting to move
+ * around, etc. after a period of adjusting them in LiveWindow mode.
+ *
+ * @param enabled True to enable LiveWindow.
*/
public static synchronized void setEnabled(boolean enabled) {
if (liveWindowEnabled != enabled) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/motorcontrol/MotorControllerGroup.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/motorcontrol/MotorControllerGroup.java
index 03d5b443df..8c74870dfb 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/motorcontrol/MotorControllerGroup.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/motorcontrol/MotorControllerGroup.java
@@ -18,6 +18,7 @@ public class MotorControllerGroup implements MotorController, Sendable, AutoClos
/**
* Create a new MotorControllerGroup with the provided MotorControllers.
*
+ * @param motorController The first MotorController to add
* @param motorControllers The MotorControllers to add
*/
public MotorControllerGroup(
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/motorcontrol/PWMSparkMax.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/motorcontrol/PWMSparkMax.java
index f14fdc7435..e90f60d757 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/motorcontrol/PWMSparkMax.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/motorcontrol/PWMSparkMax.java
@@ -26,7 +26,11 @@ import edu.wpi.first.wpilibj.PWM;
*
*/
public class PWMSparkMax extends PWMMotorController {
- /** Common initialization code called by all constructors. */
+ /**
+ * Common initialization code called by all constructors.
+ *
+ * @param channel The PWM channel number. 0-9 are on-board, 10-19 are on the MXP port
+ */
public PWMSparkMax(final int channel) {
super("PWMSparkMax", channel);
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/shuffleboard/LayoutType.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/shuffleboard/LayoutType.java
index fd827d65ce..82ffcbef20 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/shuffleboard/LayoutType.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/shuffleboard/LayoutType.java
@@ -11,6 +11,10 @@ package edu.wpi.first.wpilibj.shuffleboard;
* @see BuiltInWidgets the built-in widget types
*/
public interface LayoutType {
- /** Gets the string type of the layout as defined by that layout in Shuffleboard. */
+ /**
+ * Gets the string type of the layout as defined by that layout in Shuffleboard.
+ *
+ * @return The string type of the layout.
+ */
String getLayoutName();
}
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/shuffleboard/ShuffleboardContainer.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/shuffleboard/ShuffleboardContainer.java
index 1f0ef5e70d..98231503e1 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/shuffleboard/ShuffleboardContainer.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/shuffleboard/ShuffleboardContainer.java
@@ -15,7 +15,11 @@ import java.util.function.Supplier;
/** Common interface for objects that can contain shuffleboard components. */
public interface ShuffleboardContainer extends ShuffleboardValue {
- /** Gets the components that are direct children of this container. */
+ /**
+ * Gets the components that are direct children of this container.
+ *
+ * @return The components that are direct children of this container.
+ */
List Note that this angle is counterclockwise-positive, while most gyros are clockwise positive.
+ *
+ * @return The direction the robot is pointing.
*/
public Rotation2d getHeading() {
return new Rotation2d(getOutput(State.kHeading));
}
- /** Returns the current pose. */
+ /**
+ * Returns the current pose.
+ *
+ * @return The current pose.
+ */
public Pose2d getPose() {
return new Pose2d(getOutput(State.kX), getOutput(State.kY), getHeading());
}
@@ -447,6 +453,7 @@ public class DifferentialDrivetrainSim {
* desired. Gyro standard deviations of 0.0001 radians, velocity standard deviations of 0.05
* m/s, and position measurement standard deviations of 0.005 meters are a reasonable starting
* point.
+ * @return A sim for the standard FRC kitbot.
*/
public static DifferentialDrivetrainSim createKitbotSim(
KitbotMotor motor,
@@ -475,6 +482,7 @@ public class DifferentialDrivetrainSim {
* desired. Gyro standard deviations of 0.0001 radians, velocity standard deviations of 0.05
* m/s, and position measurement standard deviations of 0.005 meters are a reasonable starting
* point.
+ * @return A sim for the standard FRC kitbot.
*/
@SuppressWarnings("ParameterName")
public static DifferentialDrivetrainSim createKitbotSim(
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/DutyCycleEncoderSim.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/DutyCycleEncoderSim.java
index e3f3a1f762..f5c900cb27 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/DutyCycleEncoderSim.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/DutyCycleEncoderSim.java
@@ -33,7 +33,11 @@ public class DutyCycleEncoderSim {
m_simPosition.set(turns);
}
- /** Set the position. */
+ /**
+ * Set the position.
+ *
+ * @param distance The position.
+ */
public void setDistance(double distance) {
m_simPosition.set(distance / m_simDistancePerRotation.get());
}
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/SimDeviceSim.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/SimDeviceSim.java
index 84b062cafe..bca1f6f3b6 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/SimDeviceSim.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/SimDeviceSim.java
@@ -177,6 +177,7 @@ public class SimDeviceSim {
/**
* Register a callback to be run every time a value is changed on this device.
*
+ * @param value simulated value
* @param callback the callback
* @param initialNotify should the callback be run with the initial state
* @return the {@link CallbackStore} object associated with this callback. Save a reference to
@@ -197,6 +198,8 @@ public class SimDeviceSim {
* @param value simulated value
* @param callback callback
* @param initialNotify ignored (present for consistency)
+ * @return the {@link CallbackStore} object associated with this callback. Save a reference to
+ * this object so GC doesn't cancel the callback.
*/
public CallbackStore registerValueResetCallback(
SimValue value, SimValueCallback callback, boolean initialNotify) {
@@ -219,6 +222,7 @@ public class SimDeviceSim {
/**
* Register a callback to be run every time a new {@link edu.wpi.first.hal.SimDevice} is created.
*
+ * @param prefix the prefix to filter sim devices
* @param callback the callback
* @param initialNotify should the callback be run with the initial state
* @return the {@link CallbackStore} object associated with this callback. Save a reference to
@@ -234,7 +238,9 @@ public class SimDeviceSim {
* Register a callback to be run every time a {@link edu.wpi.first.hal.SimDevice} is
* freed/destroyed.
*
+ * @param prefix the prefix to filter sim devices
* @param callback the callback
+ * @param initialNotify should the callback be run with the initial state
* @return the {@link CallbackStore} object associated with this callback. Save a reference to
* this object so GC doesn't cancel the callback.
*/
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/Field2d.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/Field2d.java
index ad4ba32e97..3064f74870 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/Field2d.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/Field2d.java
@@ -69,6 +69,7 @@ public class Field2d implements Sendable {
/**
* Get or create a field object.
*
+ * @param name The field object's name.
* @return Field object
*/
public synchronized FieldObject2d getObject(String name) {
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/MechanismLigament2d.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/MechanismLigament2d.java
index 0ce2e86a38..9291aa412e 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/MechanismLigament2d.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/MechanismLigament2d.java
@@ -24,7 +24,15 @@ public class MechanismLigament2d extends MechanismObject2d {
private double m_weight;
private NetworkTableEntry m_weightEntry;
- /** Create a new ligament. */
+ /**
+ * Create a new ligament.
+ *
+ * @param name The ligament name.
+ * @param length The ligament length.
+ * @param angle The ligament angle.
+ * @param lineWidth The ligament's line width.
+ * @param color The ligament's color.
+ */
public MechanismLigament2d(
String name, double length, double angle, double lineWidth, Color8Bit color) {
super(name);
@@ -34,7 +42,13 @@ public class MechanismLigament2d extends MechanismObject2d {
setLineWeight(lineWidth);
}
- /** Create a new ligament with the default color (dark blue) and thickness (6). */
+ /**
+ * Create a new ligament with the default color (dark blue) and thickness (6).
+ *
+ * @param name The ligament's name.
+ * @param length The ligament's length.
+ * @param angle The ligament's angle relative to its parent.
+ */
public MechanismLigament2d(String name, double length, double angle) {
this(name, length, angle, 10, new Color8Bit(235, 137, 52));
}
diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/MechanismObject2d.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/MechanismObject2d.java
index e470789910..4598f7ee95 100644
--- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/MechanismObject2d.java
+++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/MechanismObject2d.java
@@ -35,6 +35,7 @@ public abstract class MechanismObject2d {
/**
* Append a Mechanism object that is based on this one.
*
+ * @param The matrix equation could also be written as x = A-1b. Where the pseudo inverse
* is used if A is not square.
*
+ * @param This filter is always stable.
*
* @param taps The number of samples to average over. Higher = smoother but slower.
+ * @return Linear filter.
* @throws IllegalArgumentException if number of taps is less than 1.
*/
public static LinearFilter movingAverage(int taps) {
diff --git a/wpimath/src/main/java/edu/wpi/first/math/kinematics/SwerveModuleState.java b/wpimath/src/main/java/edu/wpi/first/math/kinematics/SwerveModuleState.java
index d005f18866..81393763b6 100644
--- a/wpimath/src/main/java/edu/wpi/first/math/kinematics/SwerveModuleState.java
+++ b/wpimath/src/main/java/edu/wpi/first/math/kinematics/SwerveModuleState.java
@@ -56,6 +56,7 @@ public class SwerveModuleState implements Comparable A new buffer is allocated because arrays are not resizable.
+ *
+ * @param size New buffer size.
*/
void resize(int size) {
double[] newBuffer = new double[size];
@@ -150,18 +160,27 @@ public class CircularBuffer {
/**
* Get the element at the provided index relative to the start of the buffer.
*
+ * @param index Index into the buffer.
* @return Element at index starting from front of buffer.
*/
public double get(int index) {
return m_data[(m_front + index) % m_data.length];
}
- /** Increment an index modulo the length of the m_data buffer. */
+ /**
+ * Increment an index modulo the length of the m_data buffer.
+ *
+ * @param index Index into the buffer.
+ */
private int moduloInc(int index) {
return (index + 1) % m_data.length;
}
- /** Decrement an index modulo the length of the m_data buffer. */
+ /**
+ * Decrement an index modulo the length of the m_data buffer.
+ *
+ * @param index Index into the buffer.
+ */
private int moduloDec(int index) {
if (index == 0) {
return m_data.length - 1;
diff --git a/wpiutil/src/main/java/edu/wpi/first/wpiutil/ErrorMessages.java b/wpiutil/src/main/java/edu/wpi/first/wpiutil/ErrorMessages.java
index 5d568df733..80e3e32134 100644
--- a/wpiutil/src/main/java/edu/wpi/first/wpiutil/ErrorMessages.java
+++ b/wpiutil/src/main/java/edu/wpi/first/wpiutil/ErrorMessages.java
@@ -17,9 +17,11 @@ public final class ErrorMessages {
* Requires that a parameter of a method not be null; prints an error message with helpful
* debugging instructions if the parameter is null.
*
+ * @param Resources loaded on disk from extractionRoot, and from classpath from the passed in class.
- * Library name is the passed in name.
+ * @param libraryName Name of library to load.
+ * @param extractionRoot Location from which to load the library.
+ * @param cls Class whose classpath the given library belongs.
*/
public RuntimeLoader(String libraryName, String extractionRoot, Class Number of rows in vector.
* @param a A vector to subtract from.
* @param b A vector to subtract with.
* @param angleStateIdx The row containing angles to be normalized.
+ * @return Difference of two vectors with angle at the given index normalized.
*/
public static Matrix angleResidual(
Matrix a, Matrix b, int angleStateIdx) {
@@ -36,7 +38,9 @@ public final class AngleStatistics {
* Returns a function that subtracts two vectors while normalizing the resulting value in the
* selected row as if it were an angle.
*
+ * @param Number of rows in vector.
* @param angleStateIdx The row containing angles to be normalized.
+ * @return Function returning difference of two vectors with angle at the given index normalized.
*/
public static
BiFunction, Matrix> angleResidual(int angleStateIdx) {
@@ -46,9 +50,11 @@ public final class AngleStatistics {
/**
* Adds a and b while normalizing the resulting value in the selected row as an angle.
*
+ * @param Number of rows in vector.
* @param a A vector to add with.
* @param b A vector to add with.
* @param angleStateIdx The row containing angles to be normalized.
+ * @return Sum of two vectors with angle at the given index normalized.
*/
public static Matrix angleAdd(
Matrix a, Matrix b, int angleStateIdx) {
@@ -62,7 +68,9 @@ public final class AngleStatistics {
* Returns a function that adds two vectors while normalizing the resulting value in the selected
* row as an angle.
*
+ * @param Number of rows in vector.
* @param angleStateIdx The row containing angles to be normalized.
+ * @return Function returning of two vectors with angle at the given index normalized.
*/
public static BiFunction, Matrix> angleAdd(
int angleStateIdx) {
@@ -73,9 +81,11 @@ public final class AngleStatistics {
* Computes the mean of sigmas with the weights Wm while computing a special angle mean for a
* select row.
*
+ * @param Number of rows in sigma point matrix.
* @param sigmas Sigma points.
* @param Wm Weights for the mean.
* @param angleStateIdx The row containing the angles.
+ * @return Mean of sigma points.
*/
@SuppressWarnings("checkstyle:ParameterName")
public static Matrix angleMean(
@@ -101,7 +111,9 @@ public final class AngleStatistics {
* Returns a function that computes the mean of sigmas with the weights Wm while computing a
* special angle mean for a select row.
*
+ * @param Number of rows in sigma point matrix.
* @param angleStateIdx The row containing the angles.
+ * @return Function returning mean of sigma points.
*/
@SuppressWarnings("LambdaParameterName")
public static BiFunction> angleMean(
diff --git a/wpimath/src/main/java/edu/wpi/first/math/estimator/UnscentedKalmanFilter.java b/wpimath/src/main/java/edu/wpi/first/math/estimator/UnscentedKalmanFilter.java
index b1335bbbd0..b1bc4f19cc 100644
--- a/wpimath/src/main/java/edu/wpi/first/math/estimator/UnscentedKalmanFilter.java
+++ b/wpimath/src/main/java/edu/wpi/first/math/estimator/UnscentedKalmanFilter.java
@@ -329,6 +329,8 @@ public class UnscentedKalmanFilter