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

Continuous joint in URDF adds 2 elements to the configuration space #794

Open
mkatliar opened this issue May 7, 2019 · 7 comments
Open
Assignees

Comments

@mkatliar
Copy link
Collaborator

mkatliar commented May 7, 2019

Example:

auto const xml = R"urdf(
    <robot name="test">
        <link name="base">
        </link>
        <link name="link1">
            <inertial>
            <origin xyz="0. 0. 0."/>
            <mass value="1."/>
            <inertia ixx="1." ixy="0." ixz="0." iyy="1." iyz="0." izz="1."/>
            </inertial>
        </link>
        <joint name="joint0" type="continuous">
            <parent link="base"/>
            <child link="link1"/>
            <axis xyz="0. 0. 1."/>
            <origin rpy="0. 0. 0." xyz="0. 0. 0."/>
        </joint>
    </robot>
)urdf";

pinocchio::Model model;
pinocchio::urdf::buildModelFromXML(xml, model);

assert(model.nq == 1);

This code results in model.nq == 2 and the assert fails. Changing joint type to "revolute" results in model.nq == 1, as expected.

According to http://wiki.ros.org/urdf/XML/joint,

type (required)

Specifies the type of joint, where type can be one of the following:
...
continuous - a continuous hinge joint that rotates around the axis and has no upper and lower limits.

Therefore I expect a continuous joint to add 1 element to the configuration space, the same way as a revolute joint would do.

This issue seems also to be related to this question: #735 (comment)

@jmirabel
Copy link
Contributor

jmirabel commented May 7, 2019

For continuous joints, Pinocchio uses the complex representation of SO(2). The 2 elements are thus cos(theta), sin(theta).

@jcarpent
Copy link
Contributor

jcarpent commented May 7, 2019

We use cos(theta), sin(theta) to represent the configuration vector of a Continuous joint while only theta for a revolute joint.
This expected because continuous means that there are no bounds on the configuration vectors.
But for both cases, we have \dot{theta}which corresponds to the velocity of the joint.

We also use cos(theta), sin(theta) for continuous joints in a similar way we use rely on quaternions to represent the configuration of a spherical joint.

@mkatliar I hope this answer will satisfy your curiosity.

@gabrielebndn
Copy link
Contributor

gabrielebndn commented May 7, 2019

This was already the subject of a previous issue. You can find more info here: #777

@jcarpent
Copy link
Contributor

jcarpent commented May 7, 2019

I will close this issue. @mkatliar Feel free to open it again if needed.

@jcarpent jcarpent closed this as completed May 7, 2019
@mkatliar
Copy link
Collaborator Author

mkatliar commented May 7, 2019

Thank you very much for your replies, now it is clear. Would it be possible to add this explanation somewhere in the docs?

@jcarpent jcarpent reopened this May 7, 2019
@jcarpent
Copy link
Contributor

jcarpent commented May 7, 2019

Sorry. I was too fast. We will add it in the doc very soon.

@jcarpent
Copy link
Contributor

jcarpent commented May 7, 2019

@gabrielebndn Can you help me to structure the documentation of the Joint classes inside the Pinocchio doc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants