Limelight Teleop- Pathing
A simple auto-generated spline traveling through detected entities. Though this prorgam is a teleop, aspects of it can be carried over to autonomous. This program was presented by Ajay Govindarajan | 22297 - Infinibots
How this code works:
Run CVTest to play the program, your robot will attempt to find an ideal path between the etities
yellow_pollen for example.
When gamepad1.a is pressed, the robot will spline through the pollen/nectar, once it sees balls in the FOV.
Video
Quickstart:
Section titled “Quickstart:”Add the following code into your teamcode folder
It should look like this
DirectoryTeamCode
Directoryjava
Directoryorg.firstinspires.ftc.teamcode
- CVConstants.java //Add this
- CVPathGen.java //Add this
- CVCostAlgo.java //Add this
- CVTest.java //Add this
Adapt to your robot:
Section titled “Adapt to your robot:”- Measure how high your limelight is from the ground in inches, subtract
1.4from that number, and updateCAMERA_HEIGHTinCVConstantsto this number - Measure the angle that your limelight is pointing downwards in degrees, (Pointing straight means 0!), put that number inside the
CAMERA_PITCHinCVConstantsinside theMath.toRadians() - Measure how far forward your limelight lens is from the center of the robot in inches, put this number inside
FORWARD_OFFSETinCVConstants - In
CVPathGenupdate your limelight configuration name to the one listed in your driver station on line 39 - In
CVPathGenupdate your pipeline to the one that contains Hive Vision in your limelight on line 41.
Congrats, you now have Teleop - Pathing program set up for your Limelight 3A. Simply follow the directions on how to use the program at the top. Thank you for using Hive Vision!