FRCTeam2405 / FRC_2405_ChargedUp_Competition

FRC Team 2405 - Season 2023 - Charged Up - Competition Robot
https://www.fruitportrobotics.org/
Other
1 stars 0 forks source link

Drivetrain - Create subsystem for swerve drive #2

Open DCNemesis opened 1 year ago

DCNemesis commented 1 year ago

Create new subsystem focused on the swerve drive style/type

Hardware:

Examples / References:

This example uses two Rev Neo motor(s) and a Rev Thru-bore encoder per module. This is the vendor example from Rev Robotics for their MAXSwerve module.

This example uses two falcon 500 motors per module, CANCoder, and NavX. I also included the Chief Delphi post where their team offered the link to their repository for the build mentioned. This is a public team repository for a competition robot from the 2022 season.

SDS 'Swerve Drive Specialties' module. I believe this module is featured and sold by AndyMark. There are three repo's provided by the manufacturer. Two repo's offered as a template and another as an example. There are a number of posts from the same Chief Delphi thread above in which a number of teams have been successful using the SDS template for their module. Note: I have not looked at these yet.

WeltyLawrence commented 1 year ago

Added additional examples to the description.

The added examples come from a Chief Delphi post that initially talks about the difference between the WC Products SwerveX module we are using and the MK Swerve Module by SDS. The initial post I believe is around the hardware (mechanical and structural differences). However, the discussion turns to coding and one team offered a link to their team's repository for their season 2022 robot. This example uses two Talon 500 motors, a CANCoder per module and a NavX.

I also added a link to the SDS repositories which include three repositories (two 'templates' and one example). I have not looked at these yet, but I have seen a few posts in which teams have used these successfully.

I also added links for the hardware we are currently using.

WeltyLawrence commented 1 year ago

Have a working example using the newly created swerve library from FRC Team 3481. See the YAGSL 'Yet Another Generic Swerve Library' Library from Team 3481. References below.

Yet Another Generic Swerve Library YAGSL Library: Thread in Chief Delphi: https://www.chiefdelphi.com/t/yet-another-generic-swerve-library-yagsl-beta/425148 Home: https://github.com/BroncBotz3481/YAGSL/wiki API Reference: https://broncbotz3481.github.io/YAGSL/ Discussion: https://github.com/BroncBotz3481/YAGSL-Example/discussions Example Project: https://github.com/BroncBotz3481/YAGSL-Example Tuning/Json creation: https://broncbotz3481.github.io/YAGSL-Example/

DCNemesis commented 1 year ago

@2405-sk07 Our current code is using Rotation2d, which appears to just return the sine and cosine of an angle, while what we should be using is the desired angle and the current heading, as in this code: https://github.com/BroncBotz3481/YAGSL-Example/blob/1e37a3c24b60c22724a7be6e3fea5cc5e93b3e34/src/main/java/frc/robot/commands/swervedrive2/drivebase/TeleopDrive.java