Ask Your Question
0

Spherical Joint in URDF

asked 2018-10-02 09:45:32 -0500

CodeMade gravatar image

I have the following URDF. I striped out the meshes for this post. Does anyone know how to make the shapes that are on the x y and z axis move like a spherical/ball joint? If you use this URDF and launch in rviz you will see shapes representing x,y, and z axis. If you move them their anchor point is at the base.

<robot name="mira">

<material name="blue">
    <color rgba="0 0 0.8 1"/>
</material>
<material name="red">
    <color rgba="0.8 0 0 1"/>
</material>
<material name="green">
    <color rgba="0 0.8 0 1"/>
</material>
<material name="gray">
    <color rgba="0.9 0.9 0.9 1"/>
</material>


<!-- * * * Link Definitions * * * -->
<link name="base_link">
    <visual>
        <origin rpy="1.54 0 0" xyz="0 0 0.13"/>
        <geometry>

        </geometry>
        <material name="gray"/>
    </visual>
</link>



<link name="roll_M1_link">

    <visual>
        <origin rpy="0 0 0" xyz="0 0 0.125"/>
        <geometry>
            <cylinder length="0.005" radius="0.01"/>
        </geometry>
        <material name="red"/>
    </visual>
</link>
<!-- This is for color and physical properties in Gazebo, color won't work with the material tag in gazebo
only for URDF coloring -->
<gazebo reference="roll_M1_link">
    <kp>1000.0</kp>
    <kd>10.0</kd>
    <mu1>10.0</mu1>
    <mu2>10.0</mu2>
    <material>Gazebo/Red</material>
</gazebo>

<joint name="roll_joint" type="revolute">
    <parent link="base_link"/>
    <child link="roll_M1_link"/>
    <origin xyz="0.0 0 0.0" rpy="0 0 0"/>
    <limit lower="-0.4" upper="0.3" effort="0.1" velocity="0.005"/>
    <axis xyz="1 0 0"/>
</joint>


<link name="pitch_M2_link">

    <visual>
        <origin rpy="0 0 0" xyz="0.125 0 0"/>
        <geometry>
            <cylinder length="0.005" radius="0.01"/>
        </geometry>
        <material name="green"/>
    </visual>
</link>

<!-- This is for color and physical properties in Gazebo, color won't work with the material tag in gazebo
only for URDF coloring -->
<gazebo reference="pitch_M2_link">
    <kp>1000.0</kp>
    <kd>10.0</kd>
    <mu1>10.0</mu1>
    <mu2>10.0</mu2>
    <material>Gazebo/Green</material>
</gazebo>

<joint name="pitch_joint" type="revolute">
    <parent link="roll_M1_link"/>
    <child link="pitch_M2_link"/>
    <origin xyz="0 0 0" rpy="0 -1.5708 0"/>
    <limit lower="-0.22" upper="0.22" effort="0.1" velocity="0.005"/>
    <axis xyz="0 1 0"/>
</joint>



<link name="yaw_M3_link">

    <visual>
        <origin rpy="0 0 0" xyz="0 0 0.125"/>
        <geometry>
            <cylinder length="0.005" radius="0.01"/>
        </geometry>
        <material name="blue"/>
    </visual>
</link>

<!-- This is for color and physical properties in Gazebo, color won't work with the material tag in gazebo
only for URDF coloring -->
<gazebo reference="yaw_M3_link">
    <kp>1000.0</kp>
    <kd>10.0</kd>
    <mu1>10.0</mu1>
    <mu2>10.0</mu2>
    <material>Gazebo/Blue</material>
</gazebo>


<joint name="yaw_joint" type="continuous">
    <parent link="pitch_M2_link"/>
    <child link="yaw_M3_link"/>
    <origin xyz="0.01 0 0" rpy="0 1.5708 0"/>
    <limit effort="0.1" velocity="0.01"/>
    <axis xyz="0 0 1"/>
</joint>


<link name="head_link">
    <visual>
        <origin rpy="1.54 0 0" xyz="0 0 0.122"/>
        <geometry>

        </geometry>
        <material name="gray ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2020-07-31 08:17:14 -0500

Navid007 gravatar image

Let say you want Link1 to have a ball joint with Link2. In this case you have to add 3 additional links lets call them (temp1, temp2, and temp3). These links should not have transmission (unless you want to control ball joint), also you should consider very small mass for them, then it won't impact your model.

You have to connect them in this way: Link1--> temp1 --> temp2 --> temp3 --> Link2

All joints are revolute except the last one is fixed. Revolute joints connected to other and can rotate over 1 axis only.

edit flag offensive delete link more
0

answered 2018-10-02 16:00:13 -0500

David Lu gravatar image

The unsatisfying answer is that there is no native way to represent a ball joint other than similar to what you have, by breaking it into multiple joints.

edit flag offensive delete link more

Comments

Those joints don’t move like a ball joint though. They move from a point below. How do I set the center of rotation in the center of the joints I have created?

CodeMade gravatar image CodeMade  ( 2018-10-02 16:07:12 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2018-10-02 09:45:32 -0500

Seen: 577 times

Last updated: Oct 02 '18