Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shooter #93

Closed
wants to merge 2 commits into from
Closed

Shooter #93

wants to merge 2 commits into from

Conversation

wildcodemaster
Copy link

@wildcodemaster wildcodemaster commented Jan 15, 2024

What this PR does
Adds in Shooter And Shooter Behaviour. Has pid loop and toggle manual control. (v1)

What does it fix/add?
Resolves #86

@wildcodemaster wildcodemaster requested a review from a team as a code owner January 15, 2024 07:54
case ShooterState::kIdle:
{
_config.ShooterGearbox.transmission->SetVoltage(0_V);
if (_config.shooterSensor) {
Copy link
Member

Choose a reason for hiding this comment

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

you need a .Get() function here, this technically shouldnt build

units::volt_t volts = _pid.Calculate(_goal, dt, 0.2_V);

_voltage = volts;
_config.ShooterGearbox.transmission->SetVoltage(_voltage);
Copy link
Member

Choose a reason for hiding this comment

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

why not just set this straight to volts

_pid.SetSetpoint(_goal);
units::volt_t volts = _pid.Calculate(_goal, dt, 0.2_V);
_voltage = volts;
_config.ShooterGearbox.transmission->SetVoltage(_voltage);
Copy link
Member

Choose a reason for hiding this comment

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

again set this just straight to volts

}
}
break;
default:
Copy link
Member

Choose a reason for hiding this comment

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

you need a raw state

_state = state;
}
void Shooter::setRaw(units::volt_t voltage) {
_voltage = voltage;
Copy link
Member

Choose a reason for hiding this comment

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

rename this to rawVoltage

}

void ShooterManualControl::OnTick(units::second_t dt) {
// if (_codriver.GetLeftBumper()) {
Copy link
Member

Choose a reason for hiding this comment

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

remove comments

} else if (_codriver.GetRightBumper()) {
_shooter->setState(ShooterState::kSpinUp);
_shooter->setPidGoal(20_rad_per_s);
}
Copy link
Member

Choose a reason for hiding this comment

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

fix your intends

} else if (_codriver.GetRightBumper()) {
_shooter->setState(ShooterState::kSpinUp);
_shooter->setPidGoal(20_rad_per_s);
}
Copy link
Member

Choose a reason for hiding this comment

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

you need an else for raw control

_shooter->setPidGoal(20_rad_per_s);
}
}
//yay now to face... BUILD ERRORS....
Copy link
Member

Choose a reason for hiding this comment

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

remove comments

@@ -2,3 +2,20 @@ Files placed in this directory will be deployed to the RoboRIO into the
'deploy' directory in the home folder. Use the 'frc::filesystem::GetDeployDirectory'
function from the 'frc/Filesystem.h' header to get a proper path relative to the deploy
directory.



Copy link
Member

Choose a reason for hiding this comment

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

delete fred

@goanna247 goanna247 closed this Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shooter
2 participants