Skip to content

Auton Documentation

brycegerman edited this page Apr 16, 2019 · 11 revisions

Limelight Values

Limelight Interface IP Address

Input

NOTE: In order to use the 3D feature, the resolution must be set to 960x720p. *

Thresholding Values

  • Hue: 60 - 85
  • Saturation: 70 - 255
  • Value: 70 - 255

Contouring Filtering

  • Area: 0.0018 - 100
  • 10 - 100
  • 0.00 - 200

Value

  • Erosion Steps: 0
  • Dilation Steps: 0

Limelight Auton PID Control

The PID control drive is set up to read the horizontal target angle (tx) value to calculate the speed of the motors using a PID.
The target area (ta) value is used to determine distance based on the area percentage the target fills on the screen
During auton, this command is used to move the robot into scoring/intake position at the load station, rocket, and cargo ship.

Reading the Values from Network Tables

In order to read the horizontal target angle (tx) and the target area (ta) values from Network Tables, the entry must be recieved in the code.
Example:

double ta = NetworkTableInstance.getDefault().getTable("limelight").getEntry("ta").getDouble(0);
double tx = NetworkTableInstance.getDefault().getTable("limelight").getEntry("tx").getDouble(0);

In order to read the new 3D values from Networktables:
  1. Create a double array with 6 elements
  2. Set the array equal to the values from NetworkTables
  3. ```java NetworkTableInstance.getDefault().getTable("limelight").getEntry("camtran").getDoubleArray(limelightValues); ```
    NOTE: these values will only be updated if the variables are being set periodically to the values in Network Tables.

    Adding an Offset towards Targets

    In order to offset the limelight calculations to adjust for the left/right offset of the camera on the robot:

    1. Set the robot up in the ideal scoring position
    2. Turn on the limelight
    3. You May have to move the robot straight back until it sees the full target
    4. Go to the output tab on the limelight interface, and select the “offset X” option
    5. After you have done this, exit the output tab
    6. NOTE: do not select this option again if the limelight does not see a target as it will reset the offset

    Tell if Limelight is Sending Values

    The "tl" value in NetworkTables, is the latency of the limelight camera. This value can be used to check to see if the limelight is posting values to NetworkTables. The value will be constantly changing in the event values are being posted to NetworkTables

    Pathfinder Tuning Notes

    FTP into RoboRio

    • If the robot slows down in the middle of the curve, lower the acceleration
    • Turn right is a positive Y, or angle value
    • Turn left is a negative Y, or angle value
    • 2o Milliseconds time step causes the robot to react differently to max velocity, acceleration, and jerk values
      • Be advised, running multiple trajectories (one after the other) could cause:
        • The robot to take off forward at full speed (1.0 power)
          • To fix this, we reset the encoders multiple times (before the command starts and after it ends)

    Field Measurements

    • Right Load to Right Rocket Far Hatch:
      • Horizontal: 243.84 feet
      • Vertical: 9.19
      • Total Distance: 244.01 in
    • Right Load to Right Rocket Near Hatch:
      • Horizontal: 214.57 in
      • Vertical: 9.19 in
      • Total Distance: 214.77
    • Right Load to Right Rocket Center Cargo:
      • Horizontal: 229.13 in
      • Vertical: 0 in
      • Total Distance: 229.13 in

    Pathfinder File Building

    • Building a Trajectory file from Jaci Nonsense's pathfinder requires the following: