Team2337 / 2022-Presented-By-Noahs-Arcade

Other
1 stars 0 forks source link

Shooter Follower #60

Closed Nicholas-Stokes closed 2 years ago

Nicholas-Stokes commented 2 years ago

Updated the shooter code to use following motors, added the kicker wheel, and various other changes and additions.

Nicholas-Stokes commented 2 years ago

Took a first pass - should be enough to get moving on for now. Request a re-review when ready!

Also - keep in mind the API we're going to need for the shooter. I see lots of code for logging speeds and setting speeds, but no method to ask the shooter if it's up to speed. That will be important when we go to start shooting end-to-end. We don't want to feed a ball if we know the shooter isn't up to speed yet.

The question I have here is what an acceptable error of shooter speed is, because we want the shooter wheel speed to align with our target velocity, but the motor speed will fluctuate and the boolean may never trigger. I guess I can set up a deadband and that can get found out in testing.

ZachOrr commented 2 years ago

The question I have here is what an acceptable error of shooter speed is, because we want the shooter wheel speed to align with our target velocity, but the motor speed will fluctuate and the boolean may never trigger. I guess I can set up a deadband and that can get found out in testing.

Yep! This is exactly right. We should look at the shooter speed and see if it's within some tolerance to flag whether or not we're "at speed". It's the same thing with our driving commands actually. We attempt to drive a distance to the goal within a tolerance (for the flare command it's currently being tested at ~2 inches). This will for sure take some tuning on the field to figure out if that number is too high, or if we need to loosen it up a little.

The work we need to do is figure out what the tightest allowable tolerance is that will let us get "up to speed" quickly. You could go about writing code to track your "recovery time" for your shooter while you're implementing tolerances. If your deadband is too big, your recovery time will be quick, but your shots will be inaccurate. If your deadband is too small, your recovery time will be too long because you'll be waiting until you get EXACTLY in to a range. We should be able to find that "sweet spot" in the middle. I can help you write that code as well, if you need guidance.