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

new intake special movements #51

Merged
merged 7 commits into from
Mar 3, 2024
Merged

new intake special movements #51

merged 7 commits into from
Mar 3, 2024

Conversation

LandonBayer
Copy link
Contributor

this isn't necessarily ready to be pushed in yet, but I'd like y'all to check over it anyway

@@ -161,7 +157,7 @@ def periodic(self) -> None:
* constants.kPivotGearRatio,
)
self.intakeMotor.set(
NEOBrushless.ControlMode.Velocity, constants.kIntakeSpeed * -1
NEOBrushless.ControlMode.Velocity, constants.kIntakePercentageVoltage * -1
Copy link
Contributor

Choose a reason for hiding this comment

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

we should have a different ejecting voltage than intaking

self.intakeMotor.set(NEOBrushless.ControlMode.Position, self.heldPosition)

if self.putInPlace:
self.intakeMotor.set(NEOBrushless.ControlMode.Position, self.heldPosition)
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this hold position logic exist in other held areas?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this is far from done but wanted to see if this seems about right for the general idea

@lmaxwell24 lmaxwell24 force-pushed the intake-special-centering branch from 8101527 to 2ed9c4d Compare February 28, 2024 03:12
self.intakeMotor.set(
NEOBrushless.ControlMode.Position, self.heldPosition
NEOBrushless.ControlMode.Percent, constants.kIntakePercentageVoltage
Copy link
Contributor

Choose a reason for hiding this comment

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

should probably be slower here for fine control, like 1/2 speed

constants.py Outdated
50
) # Safe place roughly vertical before going to amp or trap
kAmpScoringPositionAngle = Rotation2d.fromDegrees(69.939031)
kStagingPositionangle = kAmpScoringPositionAngle
Copy link
Contributor

Choose a reason for hiding this comment

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

you set this constant to 50 degrees and then redefine it

@@ -68,6 +69,9 @@ def periodic(self) -> None:
frontLimitState = self.intakeMotor.getLimitSwitch(self.frontSensor)
backLimitState = self.intakeMotor.getLimitSwitch(self.backSensor)
self.hasPosition = backLimitState or frontLimitState
if not self.hasPosition:
self.putInPlace = False

if self.state == self.IntakeState.Intaking:
Copy link
Contributor

Choose a reason for hiding this comment

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

there's nothing in this state that tells the intake motor to run inwards, and there should also be logic for hasposition

Copy link
Contributor Author

@LandonBayer LandonBayer Feb 28, 2024

Choose a reason for hiding this comment

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

Intake running is done by voltage control, so it's assumed we have the inversion true/false the way that it is irl, also has position does have logic (it's true when either sensor is on, the line right above)

@LiamMcWeeney58 LiamMcWeeney58 self-requested a review February 29, 2024 00:17
lmaxwell24
lmaxwell24 previously approved these changes Mar 3, 2024
@lmaxwell24 lmaxwell24 merged commit 655b4fa into main Mar 3, 2024
6 checks passed
@lmaxwell24 lmaxwell24 deleted the intake-special-centering branch March 3, 2024 01:51
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.

3 participants