Origin of revolute joints don't move in Gazebo11

asked 2023-03-09 05:05:51 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi,

Can someone help me please?

My URDF file have three revolute joints (rudder_joint, sail_joint, tail_joint) with origin defined:

<robot xmlns:xacro="http://ros.org/wiki/xacro" name="sailboat">

<xacro:property name="PI" value="3.1415926535897931"/>
<xacro:property name="scale" value="1"/>

<!--_______________________-->
<!--________ HULL _________-->
<!--_______________________-->
<link name="sailboat/base_link">
    <visual>
        <origin xyz="-0.79 0 0.26" rpy="0 0 0" />
        <geometry>
            <!--mesh filename="package://sailboat_description/models/meshes/hull_material.dae" scale="${scale} ${scale} ${scale}"/-->
            <mesh filename="package://sailboat_description/models/meshes/hull_material.dae" scale="${scale} ${scale} ${scale}"/>
        </geometry>
    </visual>

    <collision name="collision">
        <origin xyz="-0.79 0 0.26" rpy="0 0 0"/>
        <geometry>
            <mesh filename="package://sailboat_description/models/meshes/hull_origin.STL" scale="${scale} ${scale} ${scale}"/>
        </geometry>
    </collision>

    <!-- Mass is calculated based on an estimate of draft, the effective length and the cross-section of
    a circle segment. The value for the draft is consistent specifications of similar vessels.  Moments of inertia are based on an effective cylindrical model-->
    <inertial>
        <mass value="184.04"/>
        <inertia ixx="5.99" ixy="0.0" ixz="0.0" iyy="230.06" iyz="0.0" izz="235.86"/>
        <origin xyz="-0.79 0 0.26" rpy="0 0 0"/>
    </inertial>
</link>


<!--_______________________-->
<!--_______ RUDDER ________-->
<!--_______________________-->
<link name="sailboat/rudder_link">
    <visual name="visual">
        <geometry>
            <!--mesh filename="package://sailboat_description/models/meshes/leme_material.dae" scale="${scale} ${scale} ${scale}"/-->
            <mesh filename="package://sailboat_description/models/meshes/leme_material.dae" scale="${scale} ${scale} ${scale}"/>
        </geometry>
        <!--origin xyz="-1.57 0 -0.21" rpy="0 0 0"/-->
        <origin xyz="0 0 0" rpy="0 0 0"/>
    </visual>

    <collision name="collision">
        <geometry>
            <mesh filename="package://sailboat_description/models/meshes/leme_origin.STL" scale="${scale} ${scale} ${scale}"/>
        </geometry>
        <!--origin xyz="-1.57 0 -0.21" rpy="0 0 0"/-->
        <origin xyz="0 0 0" rpy="0 0 0"/>
    </collision>

    <inertial>
        <mass value="1.39" />
        <inertia ixx="0.03" ixy="0.0" iyy="0.03" ixz="0.0" iyz="0.0" izz="0.01" />
        <!--origin xyz="-1.57 0 -0.21" rpy="0 0 0"/-->
        <origin xyz="0 0 0" rpy="0 0 0"/>
    </inertial>
</link>

<joint name="sailboat/rudder_joint" type="revolute">
    <parent link="sailboat/base_link"/>
    <child link="sailboat/rudder_link"/>
    <origin xyz="-1.57 0 -0.21" rpy="0 0 0"/>
    <dynamics damping="1.0"/>
    <axis xyz="0 0 1"/>
    <limit effort="100" velocity="5" lower="-${PI/2}" upper="${PI/2}" />
</joint>


<!--_______________________-->
<!--________ KEEL _________-->
<!--_______________________-->
<link name="sailboat/keel_link">
    <visual name="visual">
        <geometry>
            <!--mesh filename="package://sailboat_description/models/meshes/keel_material.dae" scale="${scale} ${scale} ${scale}"/-->
            <mesh filename="package://sailboat_description/models/meshes/keel_material.dae" scale="${scale} ${scale} ${scale}"/>
        </geometry>
        <!--origin xyz="0.54 0 -0.91" rpy="0 0 0"/-->
        <origin xyz="0 0 0" rpy="0 0 0"/>
    </visual>

    <collision name="collision">
        <geometry>
            <mesh filename="package://sailboat_description/models/meshes/keel_origin.STL" scale="${scale} ${scale} ${scale}"/>
        </geometry>
        <!--origin xyz="0.54 0 -0.91" rpy="0 0 0"/-->
        <origin xyz="0 0 0" rpy="0 0 0"/>
    </collision>

    <inertial>
        <mass value="211.39" />
        <inertia ixx="34.28" ixy="0.0" iyy="44.11" ixz="0.0 ...
(more)
edit retag flag offensive close merge delete

Comments

Are the links in the correct place before you start simulation, i.e, if you start paused?

azeey gravatar imageazeey ( 2023-03-09 22:17:53 -0500 )edit

Yes! If I start simulation paused the links are in correct place and the joints too!

jpftavares gravatar imagejpftavares ( 2023-03-10 04:28:57 -0500 )edit

Is it possible to be something related to usv_gazebo_dynamics_plugin?

jpftavares gravatar imagejpftavares ( 2023-03-10 04:35:00 -0500 )edit

I think that's possible. If for some reason, the plugin is commanding nan values to the joints, Gazebo tends to collapse the pose of every link to the origin. Can you try running it without the plugin first? Then check if the plugin is configured properly. Usually these kinds of issues happen if you have bad mass/inertia values, so I would check those as well, although, from a glance, yours looks okay to me.

azeey gravatar imageazeey ( 2023-03-10 12:59:08 -0500 )edit

Yes! Without plugin the simulation runs properly. I will check if the hydrodynamics parameters are correct. I don't know the specific parameters of my sailboat but i think the values I used aren't inappropriate. The plugin is this. The mass/inertia values I got directly from Solidworks, so I think that's are okay. Thanks for your help!

jpftavares gravatar imagejpftavares ( 2023-03-10 13:58:55 -0500 )edit

Confirmed! I changed the hydrodynamics parameters and works! Apparantely is some value of added mass... I don't konw...

jpftavares gravatar imagejpftavares ( 2023-03-10 19:51:57 -0500 )edit

By the way, if anyone wants to know what simulator i am using is VRX simulator

jpftavares gravatar imagejpftavares ( 2023-03-10 19:53:33 -0500 )edit

Great! glad to hear it's solved.

azeey gravatar imageazeey ( 2023-03-10 23:24:55 -0500 )edit