-
Notifications
You must be signed in to change notification settings - Fork 1
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
Arm: clarify target units and display Mechanism2d in AdvantageScope #96
Conversation
public double getExtensionForArmAngle(double angle) { | ||
// TODO: this is just a placeholder, the relationship will be nonlinear | ||
var degreesPerMmExtension = 0.01; | ||
return angle / degreesPerMmExtension; |
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.
⭐ check for degreesPerMmExtension being 0
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.
I think that's overkill for this placeholder logic, but I'll add it anyway
// what angle does the arm make with the pivot when it's at our concept of zero? | ||
var armPivotAngleAtArmAngleZero = 45; | ||
var color = isCalibrated() ? new Color8Bit(0, 255, 0) : new Color8Bit(255, 0, 0); | ||
var armActual2d = new Mechanism2d(10, 10, new Color8Bit(255, 255, 255)); |
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.
⭐ ⭐ the construction of this mechanism is kind of expensive; you should be able to initialize it in the constructor and update any needed fields in periodic()
.
This reverts commit 0ddd1e9.
Why are we doing this?
We said the Arm would PID on the extension distance, but we were confusing this for the target angle a lot.
This code makes that separation more clear with a placeholder conversion between angle and distance provided.
Asana task URL: https://app.asana.com/0/38541457243752/1206617786151554
Whats changing?
Questions/notes for reviewers
through this I noticed a bug where once the arm is calibrated, it won't go down again
How this was tested
arm.in.AS.mp4