Lime light driving adjustments

What are some resources for some assisted driving. I was thinking using the limelight to auto correct the robots position to make getting the balls easier. btw I’m programing in Java.

A great start is looking at the case studies on the limelight web site:

Vision Subsystem using Limelight
Turn to Target command

These are links to my code from last season, using networktables to turn to a target.
The important things to note:

  • the value TX. This value is the positioning of the target relative to the crosshair in the center of the limelight. If you have a working vision pipeline for cargo, you can use the tx value to center your robot. On the rotate to target command, look at the 2 conditional loops. Essentially the first loop will take the value of tx and feeding it to m_dT.teleop_drive, setting the result of tx * VISION_STEER_KP to the turn argument in the teleop_drive method.

  • The MIN_TURN_OUTPUT variable. If you use a method like this to turn, tx will eventually get small enough to the point where the output isn’t enough to actually move the robot. This is what the second set of conditional loops is. Essentially, it is saying if tx is between 0 and MIN_TURN_OUTPUT, set the turn argument in teleop_drive to the minimum turn output.

Hopefully this can get you started :wink:

P.S. you can get tx from Shuffleboard

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.