mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Repackage CameraServer classes (#1321)
This is necessary for modularization. Move the wpilibj CameraServer classes to the cameraserver package. Move the edu.wpi.first.wpilibj.vision package to edu.wpi.first.vision. To avoid code breakage, add deprecated copies of the wpilibj classes to the wpilibj jar.
This commit is contained in:
committed by
Peter Johnson
parent
467c9fd686
commit
0c58a0a705
@@ -5,7 +5,7 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.wpilibj;
|
||||
package edu.wpi.first.cameraserver;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -5,7 +5,7 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.wpilibj;
|
||||
package edu.wpi.first.cameraserver;
|
||||
|
||||
|
||||
public interface CameraServerShared {
|
||||
@@ -5,7 +5,7 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.wpilibj;
|
||||
package edu.wpi.first.cameraserver;
|
||||
|
||||
public final class CameraServerSharedStore {
|
||||
private static CameraServerShared cameraServerShared;
|
||||
@@ -5,7 +5,7 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.wpilibj.vision;
|
||||
package edu.wpi.first.vision;
|
||||
|
||||
import org.opencv.core.Mat;
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.wpilibj.vision;
|
||||
package edu.wpi.first.vision;
|
||||
|
||||
import org.opencv.core.Mat;
|
||||
|
||||
import edu.wpi.cscore.CvSink;
|
||||
import edu.wpi.cscore.VideoSource;
|
||||
import edu.wpi.first.wpilibj.CameraServerSharedStore;
|
||||
import edu.wpi.first.cameraserver.CameraServerSharedStore;
|
||||
|
||||
/**
|
||||
* A vision runner is a convenient wrapper object to make it easy to run vision pipelines
|
||||
@@ -5,7 +5,7 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.wpilibj.vision;
|
||||
package edu.wpi.first.vision;
|
||||
|
||||
import edu.wpi.cscore.VideoSource;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Classes in the {@code edu.wpi.first.wpilibj.vision} package are designed to
|
||||
* Classes in the {@code edu.wpi.first.vision} package are designed to
|
||||
* simplify using OpenCV vision processing code from a robot program.
|
||||
*
|
||||
* <p>An example use case for grabbing a yellow tote from 2015 in autonomous:
|
||||
@@ -19,10 +19,10 @@
|
||||
* private {@link edu.wpi.cscore.VideoSource VideoSource} usbCamera;
|
||||
*
|
||||
* // A vision pipeline. This could be handwritten or generated by GRIP.
|
||||
* // This has to implement {@link edu.wpi.first.wpilibj.vision.VisionPipeline}.
|
||||
* // This has to implement {@link edu.wpi.first.vision.VisionPipeline}.
|
||||
* // For this example, assume that it's perfect and will always see the tote.
|
||||
* private MyFindTotePipeline findTotePipeline;
|
||||
* private {@link edu.wpi.first.wpilibj.vision.VisionThread} findToteThread;
|
||||
* private {@link edu.wpi.first.vision.VisionThread} findToteThread;
|
||||
*
|
||||
* // The object to synchronize on to make sure the vision thread doesn't
|
||||
* // write to variables the main thread is using.
|
||||
@@ -34,7 +34,7 @@
|
||||
* private double distanceToTote = 0;
|
||||
*
|
||||
* {@literal @}Override
|
||||
* public void {@link edu.wpi.first.wpilibj.vision.VisionRunner.Listener#copyPipelineOutputs
|
||||
* public void {@link edu.wpi.first.vision.VisionRunner.Listener#copyPipelineOutputs
|
||||
* copyPipelineOutputs(MyFindTotePipeline pipeline)} {
|
||||
* synchronized (visionLock) {
|
||||
* // Take a snapshot of the pipeline's output because
|
||||
@@ -85,4 +85,4 @@
|
||||
* }
|
||||
* </code></pre>
|
||||
*/
|
||||
package edu.wpi.first.wpilibj.vision;
|
||||
package edu.wpi.first.vision;
|
||||
Reference in New Issue
Block a user