Skip to content
Zayd Abualfellat edited this page May 5, 2020 · 6 revisions

Vision Subsystem

In this subsystem, we used Limelight, a program that is used to help align with the tower. We also used Chameleon Vision, a program used for ball tracking.


Limelight

The Limelight is used to help position our robot towards the tower.

setLEDMode - Limelight LED Modes

  • 1 - Turns off the LEDs
  • 2 - Blink mode on LEDs
  • 3 - Turns on the LEDs

switchPipeline - Switches the Pipeline, different configurations are set

  • 0 - CloseVision (0-15 ft away from the tower)
  • 1 - MediumVision (between 15-21 ft)
  • 2 - FarVision (21-26 ft)
  • 9 - Drivecam

getDoubleValue - Gets the value from tx, ta, etc. by using a string

  • tx - Horizontal Offset From Crosshair To Target (-27 degrees to 27 degrees)
  • ty - Vertical Offset From Crosshair To Target (-20.5 degrees to 20.5 degrees)
  • ta - Target Area (0% of image to 100% of image)

calculateLimelightDistance - Calculates the distance of how far the robot is to the reflective tape on the tower


Camera

The camera on the Pi was used to track the balls. This would be used to get the balls off the ground

getChameleonVisionXDistance - Receives the X distance from Chameleon vision, helping with the rotation

  • return - Returns the value in a double

Vision Commands

These commands were used to implement the methods created in the Vision Subsystem file.

ChameleonVisionDrive - Used to go to the yellow ball based on how far it is

  • LeftWheel and RightWheel - Set to a percentage for the speed depending on how far the yellow ball is. The further the ball is, the higher the percentage it will receive. The closer the ball is, the percentage will be lower. The percentage ranges between -100% (-1.0) to 100% (1.0)

Back to top