https://github.com/stuypulse/swiveldrive
Swerve drive programmed with new kinematics
https://github.com/stuypulse/swiveldrive
Last synced: 3 months ago
JSON representation
Swerve drive programmed with new kinematics
- Host: GitHub
- URL: https://github.com/stuypulse/swiveldrive
- Owner: StuyPulse
- License: mit
- Created: 2022-08-28T01:32:29.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-31T18:40:20.000Z (almost 3 years ago)
- Last Synced: 2025-01-16T13:59:11.489Z (5 months ago)
- Language: Java
- Size: 75.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SwivelDrive
attempt at new kinematics for swerve that enable straight line spin maneuvers without corrections
## Notes
Approach:
* use a `Pose2d` to represent the position of the swerve
* use a `Translation2d[]` to represent the velocity vector of each module
* calculate the position of a module by adding its offset, rotated by the pose heading, to the pose translation
* calculate its position after the `ChassisSpeed` is applied to the module (e.g. apply the rotation and translation to the point)
* calculate a velocity vector from initial module position and the calculated final position
* calculate an acceleration vector from the provided velocity for that module and the calculated velocity vector
* store calculated velocity vector and acceleration in a `SwivelModuleState`
* return `SwivelModuleState[]`
Similar Alternative Approach:
* calculate the final pose FIRST by applying a `Twist2d`, generated from a `ChassisSpeed * period`
* calculate the modules relative to the start pose and relative to the final pose
* calculate the velocity and acceleration vectors in the same way as above the initial and final module positions
Problems:
* this covers inverse kinematics? but how to go forward
* what is the proper way to do odometry with this method?
Better method:
* direct formula that covers acceleration
* easier to do forward kinematics because algebra can be applied to the formula
* [Notes_5_CurvilinearMotion.pdf](https://github.com/StuyPulse/SwivelDrive/files/9464070/Notes_5_CurvilinearMotion.pdf)