FRC 3061 Huskie Robotics - 2023 Preseason Build Thread

3061-lib

One of the open source projects maintained by Huskie Robotics is 3061-lib. 3061-lib is a starter project and library focused on a swerve-based drivetrain. It supports SDS MK4/MK4i swerve modules using 2 Falcon 500 motors and a CTRE CANCoder, a CTRE Pigeon Gyro, and REV Robotics power distribution hub and pneumatics hub. However, due to the hardware abstraction layer, this code can be adapted to other motor controllers, encoders, and gyros as well as different swerve module designs.

If a team is looking for code to get swerve up and running the first time, there are more appropriate options than 3061-lib. 3061-lib is probably most appropriate for teams that are looking for some of these features in additional to swerve support:

  • multiple robots with different configurations, including a simulated robot with basic simulation of swerve modules
  • logging and replay via AdvantageKit
  • vision subsystem supporting multiple Photonvision-based cameras to update pose estimation
  • move-to-pose command that generates on-the-fly paths using a field model defined by a set of regions and transition points between regions
  • monitoring and reporting of hardware faults
  • integrated system tests
  • additional commands
    • drive-to-pose (closed-loop straight-line motion to pose)
    • rotate-to-angle (closed-loop rotational setpoint with optional driver-controlled translational motion)

3061 Lib v2023.2.0 is the last release for the 2023 software stack.

3061 Lib v2024.0.0-beta.0 is the first beta release for the 2024 software stack. We will continue to release updates to 3061-lib throughout the first few weeks of the build season before we pull it into our code base for the 2024 robot.

A major focus during the preseason was adding support for Cross The Road Electronics’ Phoenix 6 API. We wanted to leverage their SwerveDrivetrain class while continuing to support all of 3061-lib’s features. This required a bit of rework. To clarify, support for non-CTRE swerve drivetrains remains. You can still customize 3061-lib for any combination of motors, encoders, and gyros.

If you have any questions or comments, please ask!

2 Likes