Skip to content

Conversation

@avidraccoon
Copy link
Contributor

No description provided.

aidnem and others added 9 commits January 15, 2026 16:28
- Change team number in wpilib_preferences.json
- Update drivetrain constants for max speeds and accelerations
- Modify feature flags to disable turret operation
- Refactor drive command bindings to use DriveCoordinator
- Introduce DriveCoordinator and associated states for improved drive management
- Enhance logging for drive goal speeds and state transitions
@avidraccoon avidraccoon self-assigned this Jan 21, 2026
@avidraccoon avidraccoon linked an issue Jan 21, 2026 that may be closed by this pull request
avidraccoon and others added 13 commits January 21, 2026 09:41
…ove redundant unit registration in JsonConstants
- Introduced DriveGainsTuning mode in TestMode enum for tuning drive parameters.
- Added PIDGains class to encapsulate tuning gains for steering and driving.
- Implemented DriveTestModeState to manage tuning of drive and steer gains during operation.
- Enhanced DriveWithJoysticksState to support entry and exit actions for drive commands.
- Created LoggedTunablePIDGains class for managing and logging PID gains dynamically.
…nstants and DrivetrainConstants classes with updated configurations (WIP)
…functionality with additional methods for configuration application (WIP)
…ity; update PIDGains to include kG parameter and adjust related classes accordingly.
… implementations; update PIDGains methods to return modified configurations
@aidnem
Copy link
Contributor

aidnem commented Jan 29, 2026

@avidraccoon how's this coming along?

…update LoggedTunablePIDGains to adjust naming conventions and enhance readability.
… classes; update ModuleIOSim to adjust DRIVE_KV based on PIDGains.
@avidraccoon avidraccoon requested review from godmar and removed request for godmar January 30, 2026 00:33
@avidraccoon avidraccoon requested review from aidnem and godmar January 30, 2026 00:33
@avidraccoon avidraccoon marked this pull request as ready for review January 30, 2026 00:33
@avidraccoon
Copy link
Contributor Author

@aidnem @godmar I think this is ready for review

Copy link
Contributor

@aidnem aidnem left a comment

Choose a reason for hiding this comment

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

This is just my first pass of the constants stuff, I'll look into the states and DriveCoordinator tomorrow (I don't want to code review when I'm super tired, as I'll likely miss stuff or make silly mistakes).

"maxAngularVelocity": {
"value": 6.2,
"unit": "Radian per Second"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

why are there fields for max(Linear|Angular)Speed AND velocity here? Shouldn't there just be one?

"kV": 0.75722,
"kG": 0.0,
"kA": 0.0
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should steergains exist here too? Or will they once someone calls saveObject again? if that's the case, I don't mind not having them in here for just this merge, we can deal with it later.

@@ -1,12 +1,123 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have "DriveConstants" and "DrivetrainConstants"? Should this be called TunerConstants?

import edu.wpi.first.units.measure.Voltage;
import frc.robot.constants.JsonConstants;

public class DrivetrainConstants {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we get a javadoc explaining the distinction between DriveConstants and DrivetrainConstants?

new ModuleConfig()
.withDriveMotorId(7)
.withSteerMotorId(2)
.withEncoderId(9)
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this refactor. I assume it will still be decently portable if we have to regenerate TunerConstants?


// Temporary manual calls to load fields after JSON load
robotInfo.loadFieldsFromJSON();
drivetrainConstants.finishLoadingConstants();
Copy link
Contributor

Choose a reason for hiding this comment

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

Coppercore is now upgraded to support afterJsonLoad so you can use that here.


// Fields loaded after JSON

public CANBus kCANBus;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be JSONExcluded?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I prefer not to use the k notation before constants that aren't gains. Could we maybe name it canivoreBus or something similar to make it clear to which bus we are referring?


// @AfterJSONLoad
public void loadFieldsFromJSON() {
kCANBus = new CANBus(canivoreBusName, logFilePath);
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason you didn't use the constructor that just takes a bus name here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was from tuner constants

import edu.wpi.first.units.measure.*;

// Generated by the Tuner X Swerve Project Generator
// 2025 B BOT CONSTANTS!!!!! (dont remove put somewhere else please)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we get these immortalized in their own environment for JSON? this way, even if we do destroy this java file (which we may have to do if we regenerate tuner constants), we don't lose B bot?

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.

Add Drive States and linear drive

3 participants