mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[build] Apply spotless for java formatting (#1768)
Update checkstyle config to be compatible with spotless. Co-authored-by: Austin Shalit <austinshalit@gmail.com>
This commit is contained in:
@@ -4,16 +4,15 @@
|
||||
|
||||
package edu.wpi.first.vision;
|
||||
|
||||
import org.opencv.core.Mat;
|
||||
|
||||
import edu.wpi.cscore.CvSink;
|
||||
import edu.wpi.cscore.VideoSource;
|
||||
import edu.wpi.first.cameraserver.CameraServerSharedStore;
|
||||
import org.opencv.core.Mat;
|
||||
|
||||
/**
|
||||
* A vision runner is a convenient wrapper object to make it easy to run vision pipelines
|
||||
* from robot 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.
|
||||
* A vision runner is a convenient wrapper object to make it easy to run vision pipelines from robot
|
||||
* 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.
|
||||
*
|
||||
* @see VisionPipeline
|
||||
* @see VisionThread
|
||||
@@ -42,17 +41,16 @@ public class VisionRunner<P extends VisionPipeline> {
|
||||
* @param pipeline the vision pipeline that ran
|
||||
*/
|
||||
void copyPipelineOutputs(P pipeline);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new vision runner. It will take images from the {@code videoSource}, send them to
|
||||
* the {@code pipeline}, and call the {@code listener} when the pipeline has finished to alert
|
||||
* user code when it is safe to access the pipeline's outputs.
|
||||
* Creates a new vision runner. It will take images from the {@code videoSource}, send them to the
|
||||
* {@code pipeline}, and call the {@code listener} when the pipeline has finished to alert user
|
||||
* code when it is safe to access the pipeline's outputs.
|
||||
*
|
||||
* @param videoSource the video source to use to supply images for the pipeline
|
||||
* @param pipeline the vision pipeline to run
|
||||
* @param listener a function to call after the pipeline has finished running
|
||||
* @param pipeline the vision pipeline to run
|
||||
* @param listener a function to call after the pipeline has finished running
|
||||
*/
|
||||
public VisionRunner(VideoSource videoSource, P pipeline, Listener<? super P> listener) {
|
||||
this.m_pipeline = pipeline;
|
||||
@@ -61,15 +59,15 @@ public class VisionRunner<P extends VisionPipeline> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the pipeline one time, giving it the next image from the video source specified
|
||||
* in the constructor. This will block until the source either has an image or throws an error.
|
||||
* If the source successfully supplied a frame, the pipeline's image input will be set,
|
||||
* the pipeline will run, and the listener specified in the constructor will be called to notify
|
||||
* it that the pipeline ran.
|
||||
* Runs the pipeline one time, giving it the next image from the video source specified in the
|
||||
* constructor. This will block until the source either has an image or throws an error. If the
|
||||
* source successfully supplied a frame, the pipeline's image input will be set, the pipeline will
|
||||
* run, and the listener specified in the constructor will be called to notify it that the
|
||||
* pipeline ran.
|
||||
*
|
||||
* <p>This method is exposed to allow teams to add additional functionality or have their own
|
||||
* ways to run the pipeline. Most teams, however, should just use {@link #runForever} in its own
|
||||
* thread using a {@link VisionThread}.</p>
|
||||
* <p>This method is exposed to allow teams to add additional functionality or have their own ways
|
||||
* to run the pipeline. Most teams, however, should just use {@link #runForever} in its own thread
|
||||
* using a {@link VisionThread}.
|
||||
*/
|
||||
public void runOnce() {
|
||||
Long id = CameraServerSharedStore.getCameraServerShared().getRobotMainThreadId();
|
||||
@@ -95,11 +93,11 @@ public class VisionRunner<P extends VisionPipeline> {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {@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.
|
||||
*
|
||||
* <p><strong>Do not call this method directly from the main thread.</strong></p>
|
||||
* <p><strong>Do not call this method directly from the main thread.</strong>
|
||||
*
|
||||
* @throws IllegalStateException if this is called from the main robot thread
|
||||
* @see VisionThread
|
||||
@@ -116,9 +114,7 @@ public class VisionRunner<P extends VisionPipeline> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop a RunForever() loop.
|
||||
*/
|
||||
/** Stop a RunForever() loop. */
|
||||
public void stop() {
|
||||
m_enabled = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user