Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

spherical joint in urdf.xacro

Created a custom spherical joint using dummy links to simulate a spherical pendulum in Gazebo. Code below,

<xacro:macro name="rotational_joint" params="parent child jx jy jz r p y">
    <xacro:dummy_link name="${parent}_${child}_dummylink1"/>
    <xacro:dummy_link name="${parent}_${child}_dummylink2"/>
    <joint name="${parent}_${child}_roll" type="continuous">
        <parent link="${parent}"/>
        <child link="${parent}_${child}_dummylink1"/>
        <axis xyz="1 0 0"/>
        <!-- <joint_properties damping="0.0" friction="0.0" /> -->
        <origin xyz="${jx} ${jy} ${jz}" rpy="${r} 0 0"/>
    <joint name="${parent}_${child}_pitch" type="continuous">
        <parent link="${parent}_${child}_dummylink1"/>
        <child link="${parent}_${chilC:\fakepath\sp_smallmass.gifd}_dummylink2"/>
        <axis xyz="0 1 0"/>
        <!-- <joint_properties damping="0.0" friction="0.0" /> -->
        <origin xyz="0 0 0" rpy="0 ${p} 0"/>
    <joint name="${parent}_${child}_yaw" type="continuous">
        <parent link="${parent}_${child}_dummylink2"/>
        <child link="${child}"/>
        <axis xyz="0 0 1"/>
        <!-- <joint_properties damping="0.0" friction="0.0" /> -->
        <origin xyz="0 0 0" rpy="0 0 ${y}"/>

It works (looks) good for smaller pendulum mass but for larger mass values, the joint disconnects and (moves along the cable length in addition to the rotations). See image below (left larger mass value, right smaller mass). image description

Link to the videos vid1, vid2. Full urdf file here.

What can I try to fix this issue?

I understand there is a universal joint in Gazebo link1, link2. However, I haven't been able to get it to work. From link 2, could I potentially create a model_plugin to incorporate a spherical pendulum? Any suggestions?