mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Upgrade to wpilib alpha-6 (#2434)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ryanforce08 <rradtke1208@gmail.com> Co-authored-by: PJ Reiniger <pj.reiniger@gmail.com> Co-authored-by: Jade Turner <spacey-sooty@proton.me> Co-authored-by: Matt Morley <matthew.morley.ca@gmail.com>
This commit is contained in:
@@ -26,20 +26,22 @@
|
||||
|
||||
import drivetrain
|
||||
import wpilib
|
||||
import wpimath.geometry
|
||||
import wpimath
|
||||
from photonlibpy import PhotonCamera, PhotonPoseEstimator
|
||||
from robotpy_apriltag import AprilTagField, AprilTagFieldLayout
|
||||
|
||||
kRobotToCam = wpimath.geometry.Transform3d(
|
||||
wpimath.geometry.Translation3d(0.5, 0.0, 0.5),
|
||||
wpimath.geometry.Rotation3d.fromDegrees(0.0, -30.0, 0.0),
|
||||
kRobotToCam = wpimath.Transform3d(
|
||||
wpimath.Translation3d(0.5, 0.0, 0.5),
|
||||
wpimath.Rotation3d.fromDegrees(0.0, -30.0, 0.0),
|
||||
)
|
||||
|
||||
|
||||
class MyRobot(wpilib.TimedRobot):
|
||||
def robotInit(self) -> None:
|
||||
def __init__(self) -> None:
|
||||
"""Robot initialization function"""
|
||||
self.controller = wpilib.XboxController(0)
|
||||
super().__init__()
|
||||
|
||||
self.controller = wpilib.NiDsXboxController(0)
|
||||
self.swerve = drivetrain.Drivetrain()
|
||||
self.cam = PhotonCamera("YOUR CAMERA NAME")
|
||||
self.camPoseEst = PhotonPoseEstimator(
|
||||
|
||||
Reference in New Issue
Block a user