Open
Conversation
truher
commented
Feb 12, 2026
| public IncrementalProfileReferenceR1( | ||
| LoggerFactory parent, | ||
| Supplier<IncrementalProfile> profile, | ||
| TrapezoidIncrementalProfile profile, |
Member
Author
There was a problem hiding this comment.
you should undo this change. use a supplier, i.e. ()->profile.
| RotaryMechanism mech, | ||
| ProfileReferenceR1 ref, | ||
| FeedbackR1 feedback) { | ||
| ProfileReferenceR1 ref) { |
Member
Author
There was a problem hiding this comment.
you should undo this change
| m_log_velocity_error.log(() -> currentUnwrappedSetpoint.v() - unwrappedMeasurement.v()); | ||
| } | ||
|
|
||
| public void setPosition(double mLevel1) { |
| private void setL0() { | ||
| m_motor.setUnwrappedPosition(0, 0, 0, 0); | ||
|
|
||
| m_servo.setPosition(0); |
Member
Author
There was a problem hiding this comment.
change this (and the others) to setPositionProfiled.
|
|
||
| public Command setClimb0() { | ||
| return run(this::setL0); | ||
| return runOnce(this::setL0); |
Member
Author
There was a problem hiding this comment.
this should be "run".
the difference is that "runOnce" executes the lambda once on command initialize and then never does anything else. you want this lambda (which is ultimately "set position") to run on each iteration until it's finished.
| new PIDConstants(log, 0, 0, 0, 0, 0, 0)); | ||
| IncrementalBareEncoder encoder = m_motor.encoder(); | ||
|
|
||
| TrapezoidIncrementalProfile profile = new TrapezoidIncrementalProfile(log, 1, 2, 0.05); |
Member
Author
There was a problem hiding this comment.
you can pull the common elements (e.g. the profile) out of the switch statement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.