Skip to content

pivotpivotpivot#4

Open
gowri-k2010 wants to merge 41 commits into
mainfrom
pivotpivotpivot
Open

pivotpivotpivot#4
gowri-k2010 wants to merge 41 commits into
mainfrom
pivotpivotpivot

Conversation

@gowri-k2010

Copy link
Copy Markdown

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

@samperlmutter samperlmutter left a comment

Copy link
Copy Markdown
Member

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

@samperlmutter samperlmutter left a comment

Copy link
Copy Markdown
Member

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 thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java Outdated
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
Copy Markdown
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 thread src/main/java/frc/robot/subsystems/pivot/PivotSubsystem.java
Comment on lines +7 to +10
PivotDown((0.0)),
PivotUp((0.0)),
position(0),
PivotStowed((0.25));

Copy link
Copy Markdown
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

Comment thread src/main/java/frc/robot/subsystems/arm/ArmIOSim.java Outdated
.withMagnetOffset(magnetOffset)
.withAbsoluteSensorDiscontinuityPoint(0.625));

// public static final int ARM_KRAKEN_ID = 21;

Copy link
Copy Markdown
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

Comment thread src/main/java/frc/robot/RobotContainer.java Outdated
@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
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotPos.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotPos.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotSubsystem.java Outdated
Comment thread src/main/java/frc/robot/RobotContainer.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotSubsystem.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotSubsystem.java Outdated
Comment thread src/main/java/frc/robot/RobotContainer.java Outdated

@taran-duba taran-duba left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread src/main/java/frc/robot/subsystems/pivot/PivotPos.java
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotPos.java
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotIO.java
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java Outdated
Comment thread src/main/java/frc/robot/RobotContainer.java Outdated

@taran-duba taran-duba left a comment

Copy link
Copy Markdown
Contributor

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!

Comment thread src/main/java/frc/robot/subsystems/pivot/PivotConfigs.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotConfigs.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotSubsystem.java
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java Outdated

@samperlmutter samperlmutter left a comment

Copy link
Copy Markdown
Member

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

Comment thread src/main/java/frc/robot/subsystems/pivot/PivotConfigs.java
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotPos.java
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java Outdated

@prthik prthik left a comment

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

Choose a reason for hiding this comment

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

same here

Comment thread src/main/java/frc/robot/subsystems/pivot/PivotIO.java
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotSubsystem.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotSubsystem.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotSubsystem.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java Outdated
Comment thread src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java Outdated
@drewbxyz

Copy link
Copy Markdown
Member

@frc-reviewer

@github-actions

Copy link
Copy Markdown

FRC Code Review

PR Goal: Add a pivot subsystem powered by a TalonFX with an integrated CANcoder, integrate it into robot code, rework controller button bindings, and provide a physics simulation framework for the pivot. The PR removes the old intakeFeederwheel and flywheel subsystems and replaces them with the new pivot system.

Summary

  • 🔴 Critical: 0
  • 🟡 Warnings: 1
  • 🔵 Suggestions: 0

Files Changed

  • simgui-ds.json: Updated simulator dashboard JSON to expose Keyboard 0 settings, set its GUID to a deterministic UUID, and enable it as a gamepad.
  • src/main/java/frc/robot/RobotContainer.java ⭐: Removed intakeFeederwheel and flywheel subsystems, added a new PivotSubsystem. Updated subsystem initialization for real, simulator, and replay modes. Rewrote imports, removed unused JoystickButton reference. Reconfigured controller bindings – left bumper triggers pivot down, right trigger triggers pivot up – replacing previous intake/flywheel controls. Minor comment adjustments.
  • src/main/java/frc/robot/constants/Constants.java: Added a string constant for the RIO bus name.
  • src/main/java/frc/robot/subsystems/flywheel/FlywheelIOTalonFX.java: Removed an unused import for VoltageOut.
  • src/main/java/frc/robot/subsystems/pivot/PivotConfigs.java ⭐: Created constants and configuration objects for the pivot motor and CANcoder, including PID slots, motion magic settings, feedback, motor output, and current limits.
  • src/main/java/frc/robot/subsystems/pivot/PivotIO.java ⭐: Introduced a PivotIO interface with default methods for updating inputs, setting position, applying power, setting control requests, and stopping the motor.
  • src/main/java/frc/robot/subsystems/pivot/PivotPos.java ⭐: Added an enum to represent pivot positions (Down and Up) with conversion to radians.
  • src/main/java/frc/robot/subsystems/pivot/PivotSubsystem.java ⭐: Implemented the pivot subsystem: manages PivotIO, logs inputs, provides methods to set position or power, and exposes command wrappers for both actions.
  • src/main/java/frc/robot/subsystems/pivot/PivotTalonFX.java ⭐: Concrete PivotIO implementation using a TalonFX motor and a CANcoder sensor, applies configurations, supports simulation by adding the motor to PhysicsSim.
  • src/main/java/frc/robot/util/PhysicsSim.java ⭐: Added a singleton physics simulation manager that tracks simulated devices, offers add methods, and runs per-tick updates. Introduces a base SimProfile class with timing logic.
  • src/main/java/frc/robot/util/TalonFXSimProfile.java ⭐: Defines a simulation profile for TalonFX devices using a DCMotorSim, integrating simulated sensor state handling; added to PhysicsSim.

Issues Found

🟡 WARNING in src/main/java/frc/robot/subsystems/pivot/PivotConfigs.java:6 (hardware configuration)

Set gearRatio to the actual gear reduction for the pivot mechanism (e.g., 1.0 for 1:1) or calculate the correct value based on the gearing.

import com.ctre.phoenix6.signals.GravityTypeValue;
import com.ctre.phoenix6.signals.InvertedValue;
import com.ctre.phoenix6.signals.NeutralModeValue;
import com.ctre.phoenix6.signals.SensorDirectionValue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[WARNING] Set gearRatio to the actual gear reduction for the pivot mechanism (e.g., 1.0 for 1:1) or calculate the correct value based on the gearing.

Skill: hardware configuration

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.

7 participants