stack-of-tasks / pinocchio

A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives

Home Page:http://stack-of-tasks.github.io/pinocchio/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get the axis of a revolute joint?

2352878630 opened this issue · comments

I want to get a Vector3 type variable that represents the axis of a revolute joint.
For example, in URDF file, I already have a joint with <axis xyz="1 0 0"/>. Now I want to get a variable with a value of 1 0 0 and a type of Vector3

Thank you very much !

Unfortunately, there is not yet a direct helper to extract it.
Yet, you can recover this information partially as follows:

import pinocchio as pin
joint_model = pin.JointModelRX()
joint_data = joint_model.createData()
axis = joint_data.S[3:]

@jorisv Will you have time to add the getMotionAxis helper to all revolute and prismatic joints in Pinocchio and expose it to Python?