Skip to content
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

Merged
merged 10 commits into from
Feb 17, 2024

Conversation

aschokking
Copy link
Contributor

@aschokking aschokking commented Feb 17, 2024

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
  • unit tests added
  • tested on robot

@aschokking aschokking requested a review from a team as a code owner February 17, 2024 15:46
public double getExtensionForArmAngle(double angle) {
// TODO: this is just a placeholder, the relationship will be nonlinear
var degreesPerMmExtension = 0.01;
return angle / degreesPerMmExtension;
Copy link
Contributor

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

Copy link
Contributor Author

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));
Copy link
Contributor

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().

@aschokking aschokking changed the base branch from feature/MoreArmSafety to main February 17, 2024 17:48
@aschokking aschokking merged commit 08cdd47 into main Feb 17, 2024
3 checks passed
@aschokking aschokking deleted the arm-improvements branch February 17, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants