Skip to content

Conversation

@gowri-k2010
Copy link

Pull Request Template

There may be some issues with this tbh, I had some trouble w my device, will make further changes for sure

Type of Change

  • Bug Fix
  • New Feature
  • Code Refactor
  • Documentation Update
  • Other (please specify):

Subsystem(s) Modified

Description of Changes

Additional Context

Checklist

  • Code follows team's coding standards
  • Comments added/updated where needed
  • Constants are properly named and documented
  • Subsystem requirements are documented
  • Command requirements are documented
  • Changes have been tested in simulation (if applicable)
  • Changes have been tested on the robot (if applicable)

Screenshots/Videos

@gowri-k2010 gowri-k2010 requested a review from a team as a code owner January 14, 2026 01:51
Copy link
Member

@samperlmutter samperlmutter left a comment

Choose a reason for hiding this comment

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

i'm not sure why this is reformatting everything? it doesn't look like the formatter has changed. i can't approve this in case it causes a bunch more format errors later. can you try and build the code on your computer, then commit all of that?

@gowri-k2010 gowri-k2010 requested review from samperlmutter and removed request for samperlmutter January 16, 2026 01:48
…ivotpivotpivot

# Conflicts:
#	build.gradle
#	src/main/java/frc/robot/RobotContainer.java
#	src/main/java/frc/robot/subsystems/drive/Drive.java
Copy link
Member

@samperlmutter samperlmutter left a comment

Choose a reason for hiding this comment

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

looks pretty good for the most part. the arm is the most complete. pivot missing some things. nothing is simulated either

Comment on lines 22 to 39
private TalonFXConfiguration motorConfig() {
return new TalonFXConfiguration()
.withSlot0(
new Slot0Configs()
.withGravityType(GravityTypeValue.Arm_Cosine)
.withKD(0.0)
.withKP(0.0)
.withKI(0.0)
.withKG(0.0)
.withKS(0.0)
.withKV(0.0))
.withCurrentLimits(
new CurrentLimitsConfigs()
.withStatorCurrentLimit(0.0)
.withSupplyCurrentLimit(0.0)
.withStatorCurrentLimitEnable(true)
.withSupplyCurrentLimitEnable(true));
}
Copy link
Member

Choose a reason for hiding this comment

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

this should be moved to a PivotConfig class

Comment on lines 7 to 10
PivotDown((0.0)),
PivotUp((0.0)),
position(0),
PivotStowed((0.25));
Copy link
Member

Choose a reason for hiding this comment

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

not sure what the position enum is for. these also don't really all need Pivot at the beginning since they are on the PivotPos enum.
Consider the difference between referencing them:
PivotPos.PivotDown
vs
PivotPos.Down

.withMagnetOffset(magnetOffset)
.withAbsoluteSensorDiscontinuityPoint(0.625));

// public static final int ARM_KRAKEN_ID = 21;
Copy link
Member

Choose a reason for hiding this comment

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

looks like you can delete all this commented out code

@gowri-k2010 gowri-k2010 requested review from samperlmutter and removed request for samperlmutter January 17, 2026 22:09
@gowri-k2010 gowri-k2010 marked this pull request as draft January 18, 2026 01:34
@gowri-k2010 gowri-k2010 self-assigned this Jan 18, 2026
@yeti-robotics yeti-robotics deleted a comment from samperlmutter Jan 22, 2026
@yeti-robotics yeti-robotics deleted a comment from samperlmutter Jan 22, 2026
@yeti-robotics yeti-robotics deleted a comment from samperlmutter Jan 22, 2026
@yeti-robotics yeti-robotics deleted a comment from samperlmutter Jan 22, 2026
@yeti-robotics yeti-robotics deleted a comment from samperlmutter Jan 22, 2026
Copy link
Contributor

@taran-duba taran-duba left a comment

Choose a reason for hiding this comment

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

looks much better! still a few changes left to do

Copy link
Contributor

@taran-duba taran-duba left a comment

Choose a reason for hiding this comment

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

almost there! i think you may have accidentally resolved one of my previous comments before actually making the change so please address that!

Copy link
Member

@samperlmutter samperlmutter left a comment

Choose a reason for hiding this comment

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

looking pretty good. few clean up stuff left

Copy link

@prthik prthik left a comment

Choose a reason for hiding this comment

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

so close!

}

public Command setPositionCommand(PivotPos pivotPos) {
return runEnd(() -> setPosition(pivotPos), io::stop);
Copy link

Choose a reason for hiding this comment

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

I would advise you to use a control request. You're not moving the motor!

}

public Command applyPowerCommand(double power) {
return runEnd(() -> io.applyPower(power), io::stop);
Copy link

Choose a reason for hiding this comment

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

same here


public interface PivotIO {
@AutoLog
class PivotIOinput {

Choose a reason for hiding this comment

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

Fix casing

}

public Command setPositionCommand(PivotPos pivotPos) {
return run(() -> setPosition(pivotPos)).finallyDo(io::stop);

Choose a reason for hiding this comment

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

This can be startEnd since the control request needs to be sent only once. In fact, for MotionMagicTorqueCurrentFOC, once you pass in a position to go to, it will stay at that position, so you don't need to run io.stop() at the end. You could just use runOnce instead

}

public Command applyPowerCommand(double power) {
return run(() -> io.applyPower(power)).finallyDo(io::stop);

Choose a reason for hiding this comment

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

Same thing. You only need to send a control request once. Either startEnd or runOnce will do.


@Override
public void updateInputs(PivotIOinput inputs) {
inputs.pos = (double) pivotCan.getAbsolutePosition().getValueAsDouble();

Choose a reason for hiding this comment

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

Unnecessary type casts


@Override
public void applyPower(double power) {
pivotMotor.setControl(new DutyCycleOut(power));

Choose a reason for hiding this comment

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

Please create a single instance of DutyCycleOut and reuse that instance instead, as you did with MotionMagicTorqueCurrentFOC

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.

6 participants