forked from PhotonVision/photonvision
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'PhotonVision:master' into master
- Loading branch information
Showing
24 changed files
with
485 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
photon-core/src/main/java/org/photonvision/vision/camera/TestSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
* Copyright (C) Photon Vision. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.photonvision.vision.camera; | ||
|
||
import java.util.*; | ||
import org.photonvision.common.configuration.CameraConfiguration; | ||
import org.photonvision.vision.frame.Frame; | ||
import org.photonvision.vision.frame.FrameProvider; | ||
import org.photonvision.vision.frame.FrameThresholdType; | ||
import org.photonvision.vision.opencv.ImageRotationMode; | ||
import org.photonvision.vision.pipe.impl.HSVPipe.HSVParams; | ||
import org.photonvision.vision.processes.VisionSource; | ||
import org.photonvision.vision.processes.VisionSourceSettables; | ||
|
||
/** Dummy class for unit testing the vision source manager */ | ||
public class TestSource extends VisionSource { | ||
private FrameProvider usbFrameProvider; | ||
|
||
public TestSource(CameraConfiguration config) { | ||
super(config); | ||
|
||
if (getCameraConfiguration().cameraQuirks == null) | ||
getCameraConfiguration().cameraQuirks = | ||
QuirkyCamera.getQuirkyCamera(config.usbVID, config.usbVID, config.baseName); | ||
} | ||
|
||
@Override | ||
public FrameProvider getFrameProvider() { | ||
return new FrameProvider() { | ||
@Override | ||
public Frame get() { | ||
// TODO Auto-generated method stub | ||
throw new UnsupportedOperationException("Unimplemented method 'get'"); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return cameraConfiguration.uniqueName; | ||
} | ||
|
||
@Override | ||
public void requestFrameThresholdType(FrameThresholdType type) { | ||
// TODO Auto-generated method stub | ||
throw new UnsupportedOperationException("Unimplemented method 'requestFrameThresholdType'"); | ||
} | ||
|
||
@Override | ||
public void requestFrameRotation(ImageRotationMode rotationMode) { | ||
// TODO Auto-generated method stub | ||
throw new UnsupportedOperationException("Unimplemented method 'requestFrameRotation'"); | ||
} | ||
|
||
@Override | ||
public void requestFrameCopies(boolean copyInput, boolean copyOutput) { | ||
// TODO Auto-generated method stub | ||
throw new UnsupportedOperationException("Unimplemented method 'requestFrameCopies'"); | ||
} | ||
|
||
@Override | ||
public void requestHsvSettings(HSVParams params) { | ||
// TODO Auto-generated method stub | ||
throw new UnsupportedOperationException("Unimplemented method 'requestHsvSettings'"); | ||
} | ||
}; | ||
} | ||
|
||
@Override | ||
public VisionSourceSettables getSettables() { | ||
// TODO Auto-generated method stub | ||
throw new UnsupportedOperationException("Unimplemented method 'getSettables'"); | ||
} | ||
|
||
@Override | ||
public boolean isVendorCamera() { | ||
// TODO Auto-generated method stub | ||
throw new UnsupportedOperationException("Unimplemented method 'isVendorCamera'"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.