Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Shooter code #8

Merged
merged 9 commits into from
Dec 11, 2023
Merged

Shooter code #8

merged 9 commits into from
Dec 11, 2023

Conversation

mimizh2418
Copy link
Member

Shooter subsystem code, no commands yet since indexer code isn't done

rutmanz
rutmanz previously approved these changes Dec 10, 2023
@@ -98,6 +98,7 @@ public void teleopInit() {
if (autonomousCommand != null) {
autonomousCommand.cancel();
}
robotContainer.shooter.stop();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why stop shooter on teleop init?

Copy link
Member Author

@mimizh2418 mimizh2418 Dec 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that's left over from testing. Since the closed loop setpoints are stored persistently on the Falcons, if I were to set the motor speed and then disable the robot, when I reenable the shooter would immediately spin up to the previous speed, which is not always desirable. This would probably get fixed by commands, so I'll remove it.

private final AverageFilter averageFilter = new AverageFilter(20); // TODO: 11/28/2023 tune filter size

private double setpoint = 0;
private boolean isClosedLoop = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok but actually why do you need this variable? It's only used in isAtSetpoint to return false, which presumably would go unused when you're not trying to do closed loop control

@mimizh2418 mimizh2418 merged commit 21fc15f into main Dec 11, 2023
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants