FRC2706 / 2019-2706-Robot-Code

The main robot code for the FIRST 2019 challenge: Deep Space
MIT License
2 stars 0 forks source link

Rcvi vision2 #123

Closed KyleRAnderson closed 5 years ago

KyleRAnderson commented 5 years ago

Summary of Changes

This command is initiated from one of the buttons:

Joystick button X: Drive to nearest cargo ship target or loading bay target Joystick button Y: Drive to nearest rocket target Joystick button A: Drive to nearest ball

Pressing and holding button will:

  1. turn on green ring light
  2. make request to vision system to find the nearest target
  3. wait for vision to return a value
  4. convert coordinate from camera frame to robot frame
  5. command Pathfinder to generate trajectory from its current location to the target (offset by a tunable distance)
  6. once Pathfinder has generated the trajectory, send it to the motion control system to move robot along the trajectory
  7. turn off green ring light

Class has the following public methods to return boolean values that can be used by the rumbler to provide feedback to the driver:

getVisionTargetsDetected(): True when vision system has found the target
getTrajectoryGenerated(): True when trajectory has been generated

The operator can release button to cancel the command.

The code assumes the robot is powered on when its heading is looking down the field. (So it can know its absolute heading using the Pigeon IMU.) Practice targets need to be oriented as they would be on the field.

Note: Some associated regression tests appear to be failing after a recent update with master. An email to @KyleRAnderson and @eandr127 has been sent concerning these failing tests.

It appears that @KyleRAnderson can't be assigned as a reviewer since he created the pull request but he should review all changes as well.

Testing Performed

Environment: Tested on practice robot. Some recent changes were made that should be sanity tested, but the practice robot is not available at the moment.

KyleRAnderson commented 5 years ago

@robertlucyshyn perhaps you could provide a better description, I didn't know what to put since I didn't work on this.