Skip to content

changed it to match intake extend better#43

Open
truher wants to merge 7 commits intoTeam100:mainfrom
Harpsicord:main
Open

changed it to match intake extend better#43
truher wants to merge 7 commits intoTeam100:mainfrom
Harpsicord:main

Conversation

@truher
Copy link
Member

@truher truher commented Feb 12, 2026

No description provided.

public IncrementalProfileReferenceR1(
LoggerFactory parent,
Supplier<IncrementalProfile> profile,
TrapezoidIncrementalProfile profile,
Copy link
Member Author

Choose a reason for hiding this comment

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

you should undo this change. use a supplier, i.e. ()->profile.

RotaryMechanism mech,
ProfileReferenceR1 ref,
FeedbackR1 feedback) {
ProfileReferenceR1 ref) {
Copy link
Member Author

Choose a reason for hiding this comment

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

you should undo this change

m_log_velocity_error.log(() -> currentUnwrappedSetpoint.v() - unwrappedMeasurement.v());
}

public void setPosition(double mLevel1) {
Copy link
Member Author

Choose a reason for hiding this comment

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

remove these changes

private void setL0() {
m_motor.setUnwrappedPosition(0, 0, 0, 0);

m_servo.setPosition(0);
Copy link
Member Author

Choose a reason for hiding this comment

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

change this (and the others) to setPositionProfiled.


public Command setClimb0() {
return run(this::setL0);
return runOnce(this::setL0);
Copy link
Member Author

Choose a reason for hiding this comment

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

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);
Copy link
Member Author

Choose a reason for hiding this comment

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

you can pull the common elements (e.g. the profile) out of the switch statement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants