Reputation: 35
I'm working on constraining an IK program so that the normal vector in the end-effector frame is parallel to a known vector in the world-frame, when both are projected to the xy-plane. My initial thought was to use an AddAnglesBetweenVectorsConstraint, but that only allows me to specify the total angle between vectors, and no difference between the different axes. Is there currently a way in Drake to do this?
Edit: it turns out that this was not exactly the problem I needed to solve. In my answer below, I describe the real problem I was solving.
Upvotes: 0
Views: 106
Reputation: 35
Turns out, you can do what I wanted to do using an AddAnglesBetweenVectorsConstraint, I just misdescribed my problem. Specifically, what I really wanted was to do was enforce that the y-axis in the end effector frame (where z-axis is the direction of the end-effector, and the x-axis is straight up in said frame) was perpdinicular both to the z-axis in the world frame and the known vector in the world-frame. This is exactly what AddAngleBetweenVectorsConstraint, and it worked very nicely.
Upvotes: 0
Reputation: 5533
It seems that AddOrientationConstraint
will do what you need? If not, then you could accomplish the same with adding two PositionConstraint
s; I do precisely that in the interactive IK example in the notes for this chapter: https://manipulation.csail.mit.edu/trajectories.html .
Upvotes: 1