Skip to content

add auto-only drive current limit#147

Open
amzoeee wants to merge 1 commit into
event/norcal-statesfrom
zoe/dynamic-current-limits
Open

add auto-only drive current limit#147
amzoeee wants to merge 1 commit into
event/norcal-statesfrom
zoe/dynamic-current-limits

Conversation

@amzoeee
Copy link
Copy Markdown
Member

@amzoeee amzoeee commented Apr 10, 2026

No description provided.

@amzoeee amzoeee changed the title add auto-only current limit add auto-only drive current limit Apr 10, 2026
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 10, 2026

🤖 Augment PR Summary

Summary: Adds an autonomous-only drive-motor supply current limit to balance drivetrain performance vs. brownout risk.

Changes:

  • Reduced the default drive supply current limit and introduced a separate higher limit for autonomous
  • Applies the autonomous limit on autonomousInit() and restores the default on autonomousExit()
  • Implements a drivetrain helper to apply CurrentLimitsConfigs to all swerve module drive motors

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

public void autonomousPeriodic() {}

@Override
public void autonomousExit() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

autonomousExit() is the only place that restores the default supply current limit; if that hook doesn’t run for any reason (unexpected restart / mode transition behavior), the higher auto limit could persist into teleop. Is there a reason you’re not also ensuring the default limit is restored on other transitions?

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.


// Apply to all modules' drive motors
for (var module : getModules()) {
module.getDriveMotor().getConfigurator().apply(currentLimitsConfig);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

getConfigurator().apply(currentLimitsConfig) returns a status, but it’s ignored here; if CAN config application fails, the robot may silently keep the wrong current limit. That can make brownout/current-limit issues harder to diagnose in the pits.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

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.

1 participant