Shooter Hood Control Plan - KentridgeRobotics/2021Robot GitHub Wiki

January 30 - For four different distances, what ball angle/speed can hit the target?

Projectile trajectory

Drawing of the projectile's trajectory

Formula #1

Formula for finding maximum height from angle/speed

Formula #2 (credit to Jason)

Formula for finding displacement from angle/speed

The reason the formula is divided by 2 is because the target is halfway of the total distance the ball would travel in this formula.

After some additional calculations, we figured out the formula for the angle given a distance using a System of equations.

Substitute and simplify

The final formula we got as a subgroup: θ = arccot(d/2h) (h is the height defined in meters, we can get the height in Inches with Constants.targetHeight - Constants.cameraHeight

I tested this method on a PhET simulator (without using the half distance)

We also talked with the Shooter speed team about these formulas.

TODO: Verify this formula is correct with mentors

February 1 - Add method to adjust shooter hood angle based on distance

TODO: Implement method to calculate the hood angle using the distance reported by the Limelight. Assigned to Luke.

The method should use the formula calculated previously (making sure the Height is converted to meters) to get the angle, and set the hood angle after.

Use θ = arctan(2h/d) instead so that you can use Math.atan() to calculate the value. Make sure that the angle is in radians since Java uses radians in their trigonometric methods.

Luke has completed this method. We are far ahead of schedule. We are hoping to get the command programmed and verified by mentors on Wednesday.

Luke's method. Gets the current limelight reported distance and returns a double angle (IN DEGREES)

March 6/13 - Shooter Hood In-Person Tests

Assigned to Travis/Tony. We learned how to turn on the robot, deploy our code. The robot wasn't working properly, so we rescheduled another test the following Saturday. Since the Limelight wasn't giving output, we tested a fixed distance/angle and the hood auto command was able to adjust to it.

March 22 - Finishing the angle by zone command Add linear interpolation

March 24 - Work with speed to have their command ready for testing Add merged changes to our code

March 27 - Shooter Hood/Speed final test? Testing if the ball can make the shot from a variety of distances using the zone-based selection or calculation methods.