mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Un-finalize robotToCamera, add getters and setters (#789)
Allows teams with a mechanism that moves the camera's position (eg, a pan and tilt mechanism) to update the location of their camera for their pose calculations. --------- Co-authored-by: Matthew Morley <matthew.morley.ca@gmail.com>
This commit is contained in:
@@ -67,7 +67,7 @@ public class PhotonPoseEstimator {
|
||||
private AprilTagFieldLayout fieldTags;
|
||||
private PoseStrategy strategy;
|
||||
private final PhotonCamera camera;
|
||||
private final Transform3d robotToCamera;
|
||||
private Transform3d robotToCamera;
|
||||
|
||||
private Pose3d lastPose;
|
||||
private Pose3d referencePose;
|
||||
@@ -183,6 +183,21 @@ public class PhotonPoseEstimator {
|
||||
setLastPose(new Pose3d(lastPose));
|
||||
}
|
||||
|
||||
/** @return The current transform from the center of the robot to the camera mount position */
|
||||
public Transform3d getRobotToCameraTransform() {
|
||||
return robotToCamera;
|
||||
}
|
||||
|
||||
/**
|
||||
* Useful for pan and tilt mechanisms and such.
|
||||
*
|
||||
* @param robotToCamera The current transform from the center of the robot to the camera mount
|
||||
* position
|
||||
*/
|
||||
public void setRobotToCameraTransform(Transform3d robotToCamera) {
|
||||
this.robotToCamera = robotToCamera;
|
||||
}
|
||||
|
||||
/**
|
||||
* Poll data from the configured cameras and update the estimated position of the robot. Returns
|
||||
* empty if there are no cameras set or no targets were found from the cameras.
|
||||
|
||||
Reference in New Issue
Block a user