Completed driver assist with vision and motion control functionality
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:
turn on green ring light
make request to vision system to find the nearest target
wait for vision to return a value
convert coordinate from camera frame to robot frame
command Pathfinder to generate trajectory from its current location to the target (offset by a tunable distance)
once Pathfinder has generated the trajectory, send it to the motion control system to move robot along the trajectory
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.
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:
Class has the following public methods to return boolean values that can be used by the rumbler to provide feedback to the driver:
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.