Replies: 6 comments 12 replies
-
I suppose we can start with a rapid react shooter proved example and also mention a crescendo shooter's theoretical example Also here's orbit's behind the bumpers for 2022 and a ChiefDelphi thread (or two) on the topic. |
Beta Was this translation helpful? Give feedback.
-
Ok, well, let's begin by documenting what has been done already... Thanks to @Oliver-Cushman, we have a basic implementation already of a command that continuously aims until told not to; however, this probably won't be the final product as we will need to take into account the following pose predicted at the time of the call. /**
* The function prepares a command to fire at a stationary target while moving
* and continuously aiming until
* instructed to stop.
*
* If we are currently aiming, toggle aiming to false, cancelling repeated calls
* to prepareFireCommand
* If we are not currently aiming, toggle aiming to true,
* and repeatedly run prepareFireCommand until aiming is toggled to false
* Allows for toggling on and off of aiming with single button
*
* @param shootAtSpeaker A BooleanSupplier that determines whether the robot
* should shoot at the
* speaker.
* @param swerve The "swerve" parameter is an instance of the Swerve
* class. It is used to access the
* current pose (position and orientation) of the swerve
* mechanism.
* @return The method is returning a Command object.
*/
public Command prepareFireMovingCommand(BooleanSupplier shootAtSpeaker, Swerve swerve) {
if (aiming) {
return Commands.runOnce(() -> toggleAiming());
}
return Commands.runOnce(() -> toggleAiming())
.andThen(prepareFireCommand(shootAtSpeaker, swerve.getPose())
.repeatedly()
.until(() -> !aiming));
} |
Beta Was this translation helpful? Give feedback.
-
If we found a way to get the initial velocity from the note the moment it leaves the shooter, then we might be able to tell the shooter to go to the speed required to get the note to that desired initial velocity which we then could be able to plug into a calculator like this that finds the required initial velocity/angle for any position on the field. |
Beta Was this translation helpful? Give feedback.
-
I quickly realized the hardest part about this is converting motor rpm to note initial velocity. I hope it's just an AP physics problem. Even if it is, Davis probably wouldn't know 🗿. |
Beta Was this translation helpful? Give feedback.
-
This was solved a bit ago, we landed on a solution in which we use an interpolation map for the speeds and calculations for the turning of the robot and pivot. |
Beta Was this translation helpful? Give feedback.
-
Oh boy, where do we start...
Beta Was this translation helpful? Give feedback.
All reactions