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
txand feeding it to
m_dT.teleop_drive, setting the result of
tx * VISION_STEER_KPto the turn argument in the
MIN_TURN_OUTPUTvariable. If you use a method like this to turn,
txwill 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
txis between 0 and
MIN_TURN_OUTPUT, set the turn argument in
teleop_driveto the minimum turn output.
Hopefully this can get you started
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.