Skip to content

Releases: HuskieRobotics/3061-lib

3061 Lib v2024.3.0

26 Jul 18:11
684fe90
Compare
Choose a tag to compare

This is the final release for 2024 Crescendo season. It reflects the 3061-relevant portions of our 2024 robot code as of the last competition (IRI) plus a few minor bug fixes.

We will shift our focus to preseason projects, which will primarily be developed in the frc-software-2024 repository, which is also publicly accessible. The next 3061-lib release will be a 2025 beta that reflects the results of these preseason projects.

The changes since the v2024.2.0 release are categorized by topic in rough order of significance.

Drivetrain Subsystem

  • add ability to override rotation during PathPlanner paths (useful for targeting)
  • constrain the robot pose to stay on the field, which doesn't happen when the wheels slip when colliding with the field walls
  • reset the robot's pose to the previous pose when the pose "teleports" (i.e., changes much more than possible); why this happens rarely is still not understood but may have something to do with vision pose estimates with invalid timestamps
  • add accessor to get measured angular velocity of the drivetrain
  • add accessor to get the estimated robot pose in the future based on current velocity
  • tuned system test for drivetrain
  • add enabled inputs for drive and steer motors
  • fix bug where swerve states in inputs were not initialized
  • use new initial configs for drie and steer motors in CTRE's SwerveModuleConstantsFactory to specify current limits
  • fix bug where closed loop reference and error signals were not associated with current control mode and, therefore, returning invalid values
  • add constants for MK4i L3+
  • tune current limits for swerve drive motors
  • remove swerve drive characterization autos (need to use separate project with SysId)
  • add auto command to characterize swerve wheel diameter based on 6328's clever technique
  • fix bug in DriveToPose to account for blue field origin

Simulation

  • use TorqueCurrentFOC for steer control in simulation to match physical robot (CTRE fixed bug preventing this)

Vision

  • change behavior of reset pose to vision to wait until a recent vision pose estimate is available before applying
  • count how many times each camera provides a new estimated pose
  • add ambiguity threshold for including estimated poses from vision
  • attempt to mitigate impact of NT4 bug where timestamps may be in the future by applying a ceiling of the current time
  • only provide a vision-based robot pose if the data is less than 0.5 seconds old
  • tune function to calculate standard deviation for vision pose estimates
  • add input to capture if the estimate is from seeing multiple tags
  • fix bug where multi-tag poses would have an ambiguity of 0, which would result in standard deviations that were too low
  • fix simulation bug where the PhotonPoseEstimator needs to be provided with the transform from the camera to the robot
  • fix simulation bug where cameras added to the vision system sim don't need to have transform applied

LEDs

  • remove duplicate auto finished pulse in LEDs class
  • remove distraction LED pattern
  • add fire LED pattern
  • add orange pulse LED pattern
  • add support for GRB LED strips connected to roboRIO

Debugging

  • add names to all scheduled commands to facilitate debugging

PathPlanner Autos

  • put tuning auto paths in PathPlanner folders
  • adjust PathPlanner defaults for 2024 robot
  • add start point auto that sets the robot's pose to the specified position
  • run follow path warmup command in robotInit to force loading of PathPlanner's Java classes

Robot Configurations

  • remove 2023 robot configurations
  • add 2024 Artemis robot configurations
  • add practice board configuration for testing off-robot with basic electrical board

Field2d

  • consolidate management of current alliance color in Field2d singleton
  • add method to determine if the robot has complete left the alliance side of the field (useful in auto)

Miscellaneous

  • allow all physical toggle switches to trigger when disabled (avoids need to force toggle when enabled)
  • update to latest vendor deps
  • display LEDs and DIO ports in the sim GUI
  • add workaround from CTRE to ensure that the CANivore has been enumerated by the root hub and therefore, hoot files will be properly generated
  • add DEMO_MODE to Constants that slows robot's velocity and displays alternative LED patterns

What's Changed

Full Changelog: v2024.2.0...v2024.3.0

3061 Lib v2024.2.0

28 Feb 02:31
da566af
Compare
Choose a tag to compare

This is another minor release for the 2024 Crescendo season.

While we are now solely developing in the frc-software-2024 repository, which is also publicly accessible. The intention is that 3061-lib contains features that may be relevant to any FRC game, while frc-software-2024 will contain features specific to Crescendo. There were a few bug fixes and improvements that we wanted to back port here.

The changes since the v2024.1.0 release are categorized by topic in rough order of significance.

Drivetrain Subsystem

  • change default to field relative
  • fix bug where driveFacingAngle translation was reversed on red alliance
  • add lock to speaker button which keeps the robot pointed at its alliance speaker while driving

Simulation

  • add ArmSystemSim class and VelocitySystemSim class to make it easier to incorporate system models with Phoenix 6 devices

Vision

  • incorporate pose ambiguity into standard deviation calculation for estimated pose from vision
  • ignore vision pose estimate if too far from current estimated position (this requires use of a command to reset the pose to the estimated pose from vision)

Miscellaneous

  • update FieldConstants and Field2d classes for Crescendo
  • update to WPILib 2024.3.1 and latests vendor deps

What's Changed

Full Changelog: v2024.1.0...v2024.2.0

3061 Lib v2024.1.0

26 Jan 14:27
9c6c09b
Compare
Choose a tag to compare

This is a minor release for the 2024 Crescendo season.

We are now moving to the frc-software-2024 repository, which is also publicly accessible. The intention is that 3061-lib contains features that may be relevant to any FRC game, while frc-software-2024 will contain features specific to Crescendo. It we find significant issues, we will fix them in both repositories.

The changes since the v2024.0.0 release are categorized by topic in rough order of significance.

Drivetrain Subsystem

  • add support for driving while facing a specified angle via the TeleopSwerve command class
  • tune VelocityTorqueCurrentFOC control for swerve drive motors

Autonomous

  • add sample Choreo path integrated with PathPlanner

LED Subsystem

  • add controller-independent LED singleton with support for controlling LEDs from the roboRIO or CANdle

What's Changed

New Contributors

Full Changelog: v2024.0.0...v2024.1.0

3061 Lib v2024.0.0

14 Jan 18:00
Compare
Choose a tag to compare

This is our initial release for the 2024 Crescendo season based on 2024 software components.

We will continue to develop, test, and tune 3061-lib for a couple of weeks before moving to the frc-software-2024 repository, which is also publicly accessible. The intention is that 3061-lib contains features that may be relevant to any FRC game, while frc-software-2024 will contain features specific to Crescendo.

The changes since the v2023.2.0 release are categorized by topic in rough order of significance.

Drivetrain Subsystem

  • these changes are in addition to the Phoenix 6 changes released in v2023.2.0
  • add Drivetrain subsystem with corresponding DrivetrainIO interface
  • add DrivetrainIOCTRE class which extends CTRE's SwerveDrivetrain class in order to benefit from all their optimizations, including 250 Hz odometry updates
  • add DrivetrainIOGeneric class which can be customized for a variety of swerve motors, encoders, and gyros in the same manner as previous releases
  • update RobotOdometry to support another class managing the odometry (e.g., CTRE's SwerveDrivetrain)

PhotonVision and PhotonLib

  • leverage PhotonVision's new MULTI_TAG_PNP_ON_COPROCESSOR feature which replaces our custom multi-tag support that ran on the RIO

Static Field Origin

  • in a manner consistent with PathPlanner, the origin of the field will always be the corner to the right of the blue alliance driver station, regardless of which alliance we are
  • add 2024 Crescendo AprilTag file and update the Vision subsystem to use this file
  • add shouldFlipAutoPath method to Drivetrain class which is invoked by PathPlanner immediately before running an auto to flip the auto across the center of the field
  • update drive method of the Drivetrain class such that, in field-relative mode, pushing the joystick forward always moves the robot away from the driver and pushing the joystick left always moves the robot to the driver's left
  • remove all code related to changing the field origin, which was the 2023 approach

Phoenix 6 Pro TorqueCurrentFOC

  • add getSwerveDriveControlMode and getSwerveSteerControlMode methods to RobotConfig. By default, these methods return SWERVE_CONTROL_MODE.VOLTAGE, which is the same control mode as supported previously.
  • Classes that implement RobotConfig may return TORQUE_CURRENT_FOC to that control mode for either steer or drive motors. We have config classes for both approaches at the moment as we are still testing and tuning this new control mode and don't yet have the performance we expect. Keep in mind that the associated kS, kV, kA, kP, kI, kD values are different for these two control modes, which is why separate config classes are helpful.

Fault Reporter

  • update to detect missing CTRE devices with Phoenix 6 and report faults
  • add support for SparkMAX to FaultReporter

Serve Tuning

  • add a new "auto" to tune swerve rotation
  • log closed loop reference for swerve modules to facilitate tuning

API Changes

  • update to accommodate API changes in all dependencies (WPILib, AdvantageKit, PathPlanner, PhotonLib)

Highlighted Outstanding Issues

  • update FieldConstants and FieldRegionConstants classes for the 2024 field
  • add LED subsystem (needs more testing)

What's Changed

Full Changelog: v2023.2.0...v2024.0.0

3061 Lib v2024.0.0-beta.0

30 Dec 19:24
82e46f7
Compare
Choose a tag to compare
Pre-release

This will be the first beta based on 2024 software components. The changes are categorized by topic in rough order of significance.

Drivetrain Subsystem

  • add Drivetrain subsystem with corresponding DrivetrainIO interface
  • add DrivetrainIOCTRE class which extends CTRE's SwerveDrivetrain class in order to benefit from all their optimizations, including 250 Hz odometry updates
  • add DrivetrainIOGeneric class which can be customized for a variety of swerve motors, encoders, and gyros in the same manner as previous releases
  • update RobotOdometry to support another class managing the odometry (e.g., CTRE's SwerveDrivetrain)

Fault Reporter

  • update to detect missing CTRE devices with Phoenix 6 and report faults
  • add support for SparkMAX to FaultReporter

Serve Tuning

  • add a new "auto" to tune swerve rotation
  • log closed loop reference for swerve modules to facilitate tuning

Dependencies

  • WPIlib 2024 beta 4
  • Phoenix 6 24.0.0 beta 5
  • AdvantageKit 3.0.0 beta 6
  • PathPlanner 2024.0.0 beta 6
  • PhotonLib 2024.1.1 beta 3.2
  • RevLib 2024.0.0

What's Changed

Full Changelog: v2023.2.0...v2024.0.0b0

3061 Lib v2023.2.0

04 Nov 15:09
d6ba072
Compare
Choose a tag to compare

This will be the last release based on 2023 software components. Our focus will now shift to 2024 software components, and we plan to release a beta before kickoff updated for these new versions. The changes are categorized by topic in rough order of significance.

Phoenix 6

  • add getPhoenix6Licensed method to RobotConfig to determine if a Phoenix 6 Pro license is installed for CTRE devices
  • remove getSwerveAngleKF and getSwerveDriveKF methods from RobotConfig as they are no longer relevant with Phoenix 6
  • add setYaw method to GyroIO since this can now be done synchronously; as a result, gyroOffset in Drivetrain has been removed
  • replaced GyroIOPigeon2 with GyroIOPigeon2Phoenix6 to port to Phoenix 6
  • refactor Conversions to port to Phoenix 6 (supports units used by Phoenix 6)
  • replace custom swerve module optimize method with SwerveModuleState.optimize which is compatible with Phoenix 6 behavior
  • add closed-loop errors to SwerveModuleIOInputs to facilitate tuning (fixes log PID controller error #44)
  • change current and temperature inputs to single values instead of arrays
  • add stator and supply current to SwerveModuleIOInputs (previously was just stator)
  • replace SwerveModuleIOTalonFX with SwerveModuleIOTalonFXPhoenix6 to port to Phoenix 6. Key features:
    • FOC enabled if Phoenix 6 is licensed
    • all odometry-related signals are synchronized if Phoenix 6 is licensed (includes gyro and is managed in Drivetrain)
    • leverages high-fidelity simulation of CTRE hardware devices
  • incorporate 254 fix for swerve drift while rotating; see convertFromDiscreteChassisSpeedsToContinuous method in Drivetrain
  • add logging of autonmous paths to AdvantageScope to assist with tuning (fixes log PID controller error #44)
  • use actual timestamp when updating pose estimator instead of time from AdvantageKit
  • log measured swerve module states in addition to serve module state setpoints such that both can be displayed in AdvantageScope
  • port SubsystemIOTalonFX to Phoenix 6
  • increase DRIVE_CONTINUOUS_CURRENT_LIMIT for swerve drive motor to 50 amps
  • leverage Phoenix 6 continuous wrap feature
  • use Fused CANcoder as feedback sensor for swerve angle control

Fault Reporter

  • adapted FaultReporter (originally AdvancedSubsystem), SubsystemFault, SelfChecking classes from Ranger Robotics
  • FaultReporter is a singleton with which subsystem can register to periodically perform checks on hardware devices for faults and can register to perform automated subsystem tests (e.g., pre-match checks)
  • FaultReporter publishes results via Network Tables and is intended to be used in conjunction with Ranger Robotics’s pit display.

Serve Characterization

  • update the "Swerve Drive Characterization" auto mode to use a larger range of voltages and to use the linear least-squares method (Moore-Penrose pseudoinverse) to calculate kS, kV, and kA (fixes update characterization to include kA and span a wider range of voltages #43)
  • add the "Swerve Rotate Characterization" to characterize the swerve module's rotation mechanism
  • add characterization constants for Nova

What's Changed

Full Changelog: v2023.1.0...v2023.2.0

3061 Lib v2023.1.0

03 Jun 17:39
fa0fe19
Compare
Choose a tag to compare

This release is a back port of Huskie Robotics' code for the 2023 season. The changes are categorized by topic in rough order of significance.

Vision

  • add support for multiple cameras
  • add support for transforming coordinate system based on alliance color
  • add support for disabling vision subsystem
  • calculate standard deviation based on distance to target when adding vision measurement to pose estimator
  • add support to check if pose estimator has converged to vision-determined pose
  • add support to only add vision measurement to pose estimator if within distance threshold to tag
  • use getTimestampSeconds method instead of getLatencyMillis method to timestamp results per recommendation
  • add support to reset pose estimator based on pose derived from visible tag

Drivetrain

  • add slow-mode feature (robot velocities are scaled down when enabled)
  • add pitch and roll to gyro io inputs
  • add support to enable coast mode only after disabled for specified period of time
  • change default to field-relative mode
  • add accessors for yaw, pitch, and roll from gryo
  • add support to force field-relative driving
  • add accessor for average swerve module drive current

Move to Pose

  • add move-to-pose command to generate autonomous paths on-the-fly
  • add Field2d and Region2d classes to model field as a collection of regions with transition points between regions
  • add support for generating a path between two poses using Field2d

Commands

  • add drive-to-pose command (closed loop straight-line motion to pose)
  • add rotate-to-angle command (closed loop rotational setpoint with optional driver-controlled translational motion)
  • add configurable acceleration limiting to TeleopSwerve command

Swerve

  • add accessor for drive motor current

Subsystem

  • add generic subsystem as an example

Autonomous

  • add support for transforming paths based on alliance color
  • add "auto" path for empirically determining wheel diameter
  • add "auto" path for setting initial pose to facilitate testing
  • add "auto" path for tuning auto PID controllers

Operator Interface

  • add operator interface consisting of 2 joysticks, xBox controller, and custom operator button panel

SparkMAXFactory

  • initial release

TalonFXFactory

  • add support to configure forward and backward peak output
  • add support to configure brushless current status frame period
  • add support to configure remote sensors
  • add support to configure motion magic and motion profiling

Robot

  • add support to check alliance color and trigger updates

Misc

  • improve and add Javadoc comments
  • incorporate 6328's field constants
  • remove 2022 robot; add 2023 robot
  • add words to spelling dictionary
  • update to latest wpilib and vendor dependencies
  • remove 2022 AprilTag field layout
  • remove CANDeviceFinder and associated classes (incompatible with CANivore)

3061 Lib v2023.0.0

03 Jun 16:59
2e8fe61
Compare
Choose a tag to compare

Initial release for 2023 Charged Up season

What's Changed

New Contributors

Full Changelog: https://github.com/HuskieRobotics/3061-lib/commits/v2023.0.0