My team is building a swerve drive this year using the REV ION swerve drive kits and their example code. Our drive base is functional using field oriented drive but I would like to use SwerveDrivePoseEstimator instead of the SwerveDriveOdometry and .AddVisionMeasurement() in order to correct errors using the limelight. However, I am left with multiple questions before starting:
-
Our lime light is functional and I have uploaded the 2024 apriltag map to it. Will the PoseEstimator, with the help of limelight, be able to determine its position on the field before the round starts just by seeing apriltags? For example, lets say our robot starts the match in the middle of the field. I tell the PoseEstimator the robots current position is 0,0, then add the input of the limelight. Will the limelight be able to change the robots pose to its real one on the field? If so, what is the unit the apriltag map uses?
-
I noticed online that limelight has a java class you can insert into your project called âlimelighthelperâ and with it a method called .getBotPose(). Will calling the method: estimator.AddVisionMeasurement(limelighthelper.getBotPose(âlimelightâ),Timer.getFGATimestamp())
function as intended, making the robot pose more accurate? -
If what I talked about in the first question isnât possible or reliable, would setting the robots pose when creating the poseestimator object as the pose the limelight reads off apriltags work? If I recall correctly from when configuring the limelight you can see (and access in the code) the current X, Y, and Z position of the robot according to the apriltags.
Thanks for reading, sorry it is wordy