Conversation
…uilt2026 into anshu-commands
it does seem to kinda work tho
|
it works if you are not going that fast, so I reduced the max speed to 2/3 when not shooting but in alliance zone, and 1/3 when shooting might want a trigger to remove this, or just get arid of the aiming functionality alltogeter actually imma do that one sec kk the aiming functionality is commented out now, but still usable in case we ever want it again still max speed of 1/3 when shooting, might need to be changed later but max speed of even 1/5 normal is better than 0 |
|
also nice job anshu |
this should probs be in the other shoot command too
|
also jsut realized that the code works exactly the same as the normal one if we set the max shooting speed to 0, so I am just going to remove the "shoot on move" variable, and add a comment to it |
…tant just need to reverse the hopper after shooting is done and I will be happy
|
#45 should eventually be fixed but idk how so yeah ill do that maybe later |
all the tested positions should be in the units library and not doubles, but im too lazy to change that rn
themehdev
left a comment
There was a problem hiding this comment.
hopper should be run backward for a bit after shooting is done, shooter constants should be updated to be distances, d-pad probably shouldnt interrupt the shoot command (but there is a chance this ends up being useful if it works how I think it will work, so maybe not), but none of these are breaking and can be done later, so id say it is good to be merged in
| private Translation2d getTarget(){ | ||
| return DriverStation.getAlliance().orElse(Alliance.Blue) == Alliance.Blue | ||
| ? ShooterConstants.Positions.blueHubPose | ||
| : ShooterConstants.Positions.redHubPose; | ||
| } | ||
|
|
||
| // ONLY USE IN CONFIGURE BINDINGS | ||
| private Translation2d getVirtualTarget() { | ||
| return getTarget().minus( | ||
| new Translation2d( | ||
| MetersPerSecond.of(drivebase_.getFieldChassisSpeeds().vxMetersPerSecond).times(ShooterConstants.hangTimeOnShot), | ||
| MetersPerSecond.of(drivebase_.getFieldChassisSpeeds().vyMetersPerSecond).times(ShooterConstants.hangTimeOnShot) | ||
| ) | ||
| ); | ||
| } | ||
|
|
There was a problem hiding this comment.
These would probably be best moved elsewhere, or if they are not used more than once, directly into your commands
There was a problem hiding this comment.
will happen when I move the main thing into a shootCommand
| DriveCommands.joystickDriveAtAngle( | ||
| drivebase_, | ||
| () -> -gamepad_.getLeftY() * Constants.shootOnMoveMaxSpeed, | ||
| () -> -gamepad_.getLeftX() * Constants.shootOnMoveMaxSpeed, | ||
| () -> { | ||
| var hubTranslation = getVirtualTarget().minus(drivebase_.getPose().getTranslation()); | ||
| var rotation = new Rotation2d(hubTranslation.getX(), hubTranslation.getY()); | ||
|
|
||
| return rotation; |
There was a problem hiding this comment.
Maybe move this into the shooter subsystem as "shootCmd" / "shootOnMoveSequence" or some class like "___Commands.java". Ideally these could be two commands, shootOnMove, and shootStill, which we can choose to use either in the code
There was a problem hiding this comment.
Yeah, i will just move this all into a shootCommand(boolean moving), so we can pass in that variable there instead, so that we can have it in multiple places if nessecary
There was a problem hiding this comment.
I think for the cleanest setup, you could create two commands, and then bind the trigger to a conditional command based on a Boolean. This would allow auto modes to use whichever shooter they want, with clear and concise command names, while still allowing the triggers to be conditional.
| private static final RobotType robotType = RobotType.COMPETITION; | ||
|
|
||
| public static final boolean spawnLessFuelInSim = true; | ||
| //public static final boolean shootOnMove = false; // if true, we will allow the driver to shoot while moving, but with reduced max speed. if false, we will not allow the driver to shoot while moving. |
There was a problem hiding this comment.
I think that we should keep this boolean, it's much more readable and simple to use a Boolean than to read comments for something that you wouldn't originally expect to enable or disable a feature.
There was a problem hiding this comment.
as I said before, because just setting a moving speed of 0 is the same thing as stationary, I don't think that we need a boolean as a constant, but there will be one in the shoot command once I move everything over to the shooter subsystem tomorrow
uhm idk it kinda works but not really
idk what the prob is tho, ill work on this more tomorrow