rdiankov / openrave

Open Robotics Automation Virtual Environment: An environment for testing, developing, and deploying robotics motion planning algorithms.
http://www.openrave.org
Other
720 stars 343 forks source link

Create IK with mimic joints #247

Open akaDlock opened 11 years ago

akaDlock commented 11 years ago

How can I create Ik-library with openRave for my robot-model, which contains mimic joints

rdiankov commented 11 years ago

first, joints with mimic equations are accessed by KinBody.GetPassiveJoints() , regular joints are KinBody.GetJoints(). For each mimic joint, you can get its equation via: KinBody.Joint.GetMimicEquation().

in ikfast.py, the forward kinematics equations are built using the forwardKinematicsChain . You'll notice that the arguments are chainlinks and chainjoints, they are:

chainlinks = self.kinbody.GetChain(baselink,eelink,returnjoints=False)
chainjoints = self.kinbody.GetChain(baselink,eelink,returnjoints=True)
LinksRaw, jointvars = self.forwardKinematicsChain(chainlinks,chainjoints)

fortunately the KinBody.GetChain also returns the mimic joints, so you should have all information necessary to setup the correct matrices LinksRaw.

let me know if there's any problems.

akaDlock commented 11 years ago

Thank you, I'll try it.