-
Notifications
You must be signed in to change notification settings - Fork 19
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 convenience function to compute forward kinematics #251
Conversation
|
||
# Save the robot state | ||
sp = openravepy.Robot.SaveParameters | ||
with robot.CreateRobotStateSaver(): |
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.
It would be better to only pass the LinkTransformations
option here. Otherwise we'll save a bunch of extra state that we don't modify (e.g. joint limits, active DOFs, etc).
GetForwardKinematics() returns the end-effector transform w.r.t. the "/world" frame. I'm thinking about adding an optional argument to specify the desired reference frame, ...
# Example: frame = '/right/wam_base'
from tf import transformations
if frame != None:
T_ref_frame = robot.GetLink(frame).GetTransform()
T_ee = transformations.concatenate_matrices(numpy.linalg.inv(T_ref_frame), T_ee) |
I noticed that a more general version of this functionality exists in Is this sufficient for your needs? Or, if not, it would be nice to implement the new function in terms of the existing ones. Thoughts? |
The GetForwardKinematics() function has 4 lines of code and is very easy to understand. I think we should add it. I don't think GetForwardKinematics() should wrap a complicated function that is 53 lines and more difficult to understand. |
|
||
if frame != None: | ||
T_ref_frame = robot.GetLink(frame).GetTransform() | ||
T_ee = transformations.concatenate_matrices(numpy.linalg.inv(T_ref_frame), T_ee) |
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'd prefer to not add a tf
dependency for this. Could you use numpy.dot
instead?
I am fine with merging this if you: (1) remove the |
…ffectorTransform()
|
Add convenience function to compute forward kinematics
I can add a simple unit test that checks if a specific configuration returns the expected end effector transform?