FRC1076 / FRC1076/2022-Competition
Feature: Center of Mass adjustment for Swerve Drive
- Dominant language
- Python
- Stars
- 1
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Get the swerve drive to work with variable center of mass.
The implementation should involve storing the relative positions and distances of each module (by the module's center of rotation) to be passed in during the instantiation of the swerve drive class. The outputs of the swerve math should then be normed so that the drive speed of each module is inversely proportional to it's lever arm (distance to CoM).
The easiest way to do this may be to re-write all of the math, using either the WPILib swerve kinematics, or the general mathematical model for swerve (see https://dominik.win/blog/programming-swerve-drive/ )
Otherwise, assuming the current math works for a square bot, it may work to just scale the drive outputs by 1/(distance from CoM), after norming all of these distances to their average (so that a module which is the average distance away out of the 4 modules is multiplied by 1, those that are closer than average are scaled up, and those that are further than average are scaled down)... this is easier but may be less accurate.
Acceptance Test:
The rectangular bot with offset CoM drives well without any significant drift (after any error in measurement has been eliminated)
Preconditions: Square swerve drive is functioning. All swerve modules behave predictably and the gyroscope is calibrated.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the swerve drive class and the current swerve math, then compare the implementation with WPILib swerve kinematics or the linked mathematical model. Define how module positions and distances are passed during instantiation, and validate the result with a rectangular bot with an offset center of mass, confirming no significant drift after measurement errors are removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- robotics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100