Approach to determining a lift and power height

Hi,

For the 2024 season our team has a robot with a shooter attached to a lift. Meaning when shooting at the subwoofer, we can control how high the shooter is and the speed of the flywheels. Whats the typical approach when it comes to calculating the power of a flywheel to shoot a certain distance into a target such as the Subwoofer? And futhermore, also calculating the height the lift should be at. We sort of don’t know how you’d typically approach this or what sort wpilib articles we should look at and whatnot. Any help and suggestions is appreciated.

Thanks in advance, :grin:

Experimentation!

The typical approach is to just create a lookup table for values. For a number of different distances, just hand tune all the parameters (elevator height, shooter angle, shooter RPM) that make the shot reliably. If your robot is in between two of the distances you tested, do some linear interpolation to estimate what a parameter should be at that distance.

WPILib has a InterpolatingTreeMap class as a built-in data structure to support this use case.

Team 1706’s approach is to use trial-and-error at a few different distances and then to put those values we got on an interpolation table. If the robot is at an undefined distance, then it linearly interpolates between two defined distances.
interpolate
You can see this worked very well in this video: https://www.youtube.com/watch?v=V1hFQcEPkn8

Here’s the post by our head mentor about how we got this working (most of the helpful information is in the replies: Shoot While Move Code (1706)
And here’s the post with our public code release: 1706 Code Public Release

Ooooo, thanks for letting me know about the InterpolatingTreeMap class! And about the lookup table approach.

Oooooh thank you! thats quite a bit of specific information.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.