Class SynapseWrapper
java.lang.Object
yall.VisionCamera
yall.cameras.SynapseWrapper
- All Implemented Interfaces:
AutoCloseable
A Synapse camera.
Synapse reports target positions in pixels; this wrapper turns them into angles with the
config's camera properties, so set them to match
the camera. Synapse doesn't report target area or AprilTag ambiguity, so those are Double.NaN and the pose filter's ambiguity check is skipped.
Pose estimates come from Synapse's field-space camera pose and the config's robot-to-camera
transform. Synapse has no heading-assisted mode, so PoseEstimationMode.HEADING_ASSISTED works like PoseEstimationMode.TAGS_ONLY.
Without camera properties in the config, it is simulated, and turns pixels into angles, as a
CameraModel.ARDUCAM_OV9281.
No vendor configs are accepted; use getCamera() for Synapse settings.
-
Field Summary
Fields inherited from class VisionCamera
config, name -
Constructor Summary
ConstructorsConstructorDescriptionSynapseWrapper(synapse.SynapseCamera camera, VisionCameraConfig config) Wraps a Synapse camera. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyPipelineIndex(int index) Switches the real camera's pipeline.protected voidapplyRobotToCamera(Transform3d robotToCamera) Passes a new camera position to the real camera, for cameras that use it themselves.voidclose()Closes the results subscriber, then the parts every camera shares.synapse.SynapseCameraThe vendor's camera object, for settings YALL doesn't cover.protected booleanWhether the real camera is sending data.protected List<VisionFrame> Reads the frames the real camera produced since the last call.protected intReads the real camera's pipeline.Methods inherited from class VisionCamera
addVisionMeasurements, applyRobotOrientation, cacheRobotToCamera, checkEstimate, forEachEstimatedPose, getBestTarget, getCameraFieldPose, getCameraSim, getCameraYawOnRobot, getConfig, getEstimatedPose, getEstimatedPoses, getFilterStats, getLastRejectionReason, getLatestResult, getName, getPipelineIndex, getRejectedPoses, getRobotToCamera, getSimulatedPoseEstimator, getTargets, getUnreadResults, getVisionSim, hasTargets, isConnected, isSimulated, resetFilterStats, setPipelineIndex, setRobotOrientation, setRobotOrientation, setRobotOrientation, setRobotToCamera, setRobotToCamera, update
-
Constructor Details
-
SynapseWrapper
Wraps a Synapse camera.- Parameters:
camera- The Synapse camera.config- The camera's config.
-
-
Method Details
-
readFrames
Description copied from class:VisionCameraReads the frames the real camera produced since the last call. Call once per loop.- Specified by:
readFramesin classVisionCamera- Returns:
- The frames, oldest first.
-
applyPipelineIndex
protected void applyPipelineIndex(int index) Description copied from class:VisionCameraSwitches the real camera's pipeline.- Specified by:
applyPipelineIndexin classVisionCamera- Parameters:
index- Pipeline index.
-
readPipelineIndex
protected int readPipelineIndex()Description copied from class:VisionCameraReads the real camera's pipeline.- Specified by:
readPipelineIndexin classVisionCamera- Returns:
- Pipeline index.
-
readConnected
protected boolean readConnected()Description copied from class:VisionCameraWhether the real camera is sending data.- Specified by:
readConnectedin classVisionCamera- Returns:
- true if connected.
-
applyRobotToCamera
Description copied from class:VisionCameraPasses a new camera position to the real camera, for cameras that use it themselves.- Overrides:
applyRobotToCamerain classVisionCamera- Parameters:
robotToCamera- Transform from the robot origin to the camera.
-
getCamera
public synapse.SynapseCamera getCamera()Description copied from class:VisionCameraThe vendor's camera object, for settings YALL doesn't cover. Each wrapper narrows the return type to its vendor's class.- Specified by:
getCamerain classVisionCamera- Returns:
- The vendor's camera object.
-
close
public void close()Closes the results subscriber, then the parts every camera shares.- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classVisionCamera
-