-
Notifications
You must be signed in to change notification settings - Fork 18
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
Shooter #93
Conversation
case ShooterState::kIdle: | ||
{ | ||
_config.ShooterGearbox.transmission->SetVoltage(0_V); | ||
if (_config.shooterSensor) { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
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); | ||
} |
There was a problem hiding this comment.
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); | ||
} |
There was a problem hiding this comment.
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.... |
There was a problem hiding this comment.
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. | |||
|
|||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete fred
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