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

Clarification on joint angle definitions #10

Open
Tyler-Curnow opened this issue Apr 2, 2024 · 4 comments
Open

Clarification on joint angle definitions #10

Tyler-Curnow opened this issue Apr 2, 2024 · 4 comments

Comments

@Tyler-Curnow
Copy link

When you say that the arm is "stretched out" when all servos are at 90 degrees do you mean that the arm will be standing straight up? Why is it that all joint angles would be 90 degrees? Would it not be 90 degrees for the base with 0 degrees for the remaining angles (ie upperarm, forearm, wrist)?

Typically aren't joint angles measured from the projection of the previous link? For example, if you had the arm standing straight up with the elbow bent 90 degrees to the right, the joint angles would be as follows: Shoulder -> 90, Elbow -> 90 (or 270 depending on how you are measuring), wrist ->180

I am trying to adapt your code to an arm run by linear actuators and I keep getting no solution found and I believe this is the issue, if you could clarify with some drawings it would be very helpful.

@cgxeiji
Copy link
Owner

cgxeiji commented Apr 3, 2024

Thank you for your question!

The angle calculated by the ik solver is described here. This is the angle you get in radians that is based on the projection from link to link. This angle will be indeed 0 to pi. Then you need to transform this angle to the actual range of your servos (which is done by the a2b function in the README example) which could be 0 to 180.

If you assembled your arm so that your servo is stretched out at 180 degrees (or 0 degrees, in which case you will need to transform the angle with servo = 180-angle), then you are right! If you however assembled your arm so that your servo goes from 0 degrees left, 90 degrees stretched, 180 degrees right, then you need to transform you angle to account for that, in which case the arm will be stretched out at 90 degrees. The final angles depends on how you physically built the arm.

I hope this answered your question!

@Tyler-Curnow
Copy link
Author

I think that answers my question, I am going to draw out what I am trying to do and send a more detailed explanation, I am still getting an error.

@Tyler-Curnow
Copy link
Author

Image below,

So I have an arm that I built that has 3 links and 3 joints. The first link, the upperarm has a length of 24.7", the forearm has a length of 17.5", and the end of the arm has a length of 3.1". I have a shoulder/base joint, an elbow joint, and a wrist joint.

I understnad that your code is for the braccio arm but it should theoretically work for my arm as well given that I only move in the X,Z plane and only pass Y as zero as I do not have a rotating base.

I was unsure how you were getting your joint angles so I redrew my arm with the same method as your cosine rule, the joint angles are now measured from the previous link to the next. Again, this can be seen in the picture below.

The shoulder joint has a max min angle of: .1° to 62°
The elbow joint has a max min angle of: 59° to 147°
The wrist joint has a max min angle of: 128° to 180°

I follow your example and plug in these limits as well as joint lengths but when I pass a valid position to the solver I get an error saying that it is not a valid location. What do you think is the issue?
IMG_3542

@Tyler-Curnow
Copy link
Author

Hey any update? I am still struggling to get this to work...

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

No branches or pull requests

2 participants