-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add drive command with smoother inputs #36
Conversation
linglejack06
commented
Nov 12, 2024
- square linear velocity while retaining direction of x and y
- square omega input using Math.copySign to retain direction
- rename wpi_interface to wpilib_interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment. Any sim evidence would be good before we put this on the robot
double deadband = Deadband.oneAxisDeadband(Math.hypot(x, y), 0.1); | ||
|
||
Rotation2d direction = new Rotation2d(x, y); | ||
double squaredMagnitude = deadband * deadband; | ||
|
||
Translation2d linearVelocity = | ||
new Pose2d(new Translation2d(), direction) | ||
.transformBy(new Transform2d(squaredMagnitude, 0.0, new Rotation2d())) | ||
.getTranslation(); | ||
|
||
return linearVelocity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic is sus to me, and definitely needs to be tested
If it works, we will need some comments added to explain the logic and why it works