revolute joint dos not work when adding an angular velocity to the model

asked 2018-01-12 08:51:13 -0500

Mobile_robot gravatar image

Hi,

I am new to the Gazebo. I have made a model plugin (based on the Animated Box example. My model has two revolute joints (each are limited to the 15°). When I add an angular velocity to the model by

            this->model->SetAngularVel(math::Vector3(0, 0, LinearSpeed));

The revolute joints stop moving. Can any one help me how I can make the joints moving in the moment of the rotation of the model?

Thanks ,

You can find below my source files.

World's SDF File

Blockquote

<sdf version="1.6"> <world name="Joint_test">

<!-- Ground Plane -->
<include>
    <uri>model://ground_plane</uri>
</include>

<include>
    <uri>model://sun</uri>
</include>

<model name="demo_joint_types">     
<!-- A Heavy base keeps the joints from falling over -->
    <link name="heavy_base01">          
    <!-- position the base such that the bottom touches the floor -->
        <pose>1 0.01 0.05 0 0 0</pose>
        <inertial>
            <mass>100</mass> <!-- kg -->
            <inertia>
                <!-- (mass / 12) * (y*y + z*z) -->
                <ixx>8,3341</ixx>
                <ixy>0</ixy>
                <ixz>0</ixz>
                <!-- (mass / 12) * (x*x + z*z) -->
                <iyy>8,3341</iyy>
                <iyz>0</iyz>
                <!-- (mass / 12) * (y*y + x*x) -->
                <izz>16,666</izz>
            </inertia>
        </inertial>
        <!-- Same geometry as visual -->
        <collision name="heavy_base_collision01">
        <geometry>
            <box>
                <size>1 1 0.01</size>
            </box>
        </geometry>
        </collision>
        <!-- Same geometry as collision -->
        <visual name="heavy_base_visual01">
            <geometry>
                <box>
                    <size>1 1 0.01</size>
                </box>
            </geometry>
        </visual>
    </link> 

    <link name="revolute_base01">
    <!-- Put the bottom of the child on top of the parent
    z = 0.5 * revolute_base_sz_z + heavy_base_sz_z
    x = put it near revolute label on heavy base
    -->
    <pose >1 0.01 0.8 0 0 0</pose>
        <inertial>
            <inertia>
            <!-- (mass / 12) * (y*y + z*z) -->
                <ixx>0.1868</ixx>
                <ixy>0</ixy>
                <ixz>0</ixz>
                <!-- (mass / 12) * (x*x + z*z) -->
                <iyy>0.1867</iyy>
                <iyz>0</iyz>
                <!-- (mass / 12) * (y*y + x*x) -->
                <izz>0.0000415</izz>
            </inertia>
        </inertial>
        <!-- Same geometry as visual -->
        <collision name="revolute_base_collision01">
            <geometry>
                <box>
                    <size>0.01 0.02 1.5</size>
                </box>
            </geometry>
        </collision>
        <!-- Same geometry as collision -->
        <!--<visual name="revolute_base_visual01">
            <geometry>
                <box>
                    <size>0.01 0.02 1.5</size>
                </box>
            </geometry>
        </visual>  -->
    </link>

    <joint name="revolute_base_to_heavy_base01" type="fixed">
        <parent>heavy_base01</parent>
        <child>revolute_base01</child>
    </joint>

    <link name="revolute_base02">
    <!-- Put the bottom of the child on top of the parent
    z = 0.5 * revolute_base_sz_z + heavy_base_sz_z
    x = put it near revolute label on heavy base
    -->
        <pose >1 -0.01 0.8 0 0 0</pose>
        <inertial>
            <inertia>
                <!-- (mass / 12) * (y*y + z*z) -->
                <ixx>0.1868</ixx>
                <ixy>0</ixy>
                <ixz>0</ixz>
                <!-- (mass / 12) * (x*x + z*z) -->
                <iyy>0.1867</iyy>
                <iyz>0</iyz>
                <!-- (mass / 12) * (y*y + x*x) -->
                <izz>0.0000415</izz>
            </inertia>
        </inertial>
        <!-- Same geometry as visual -->
        <collision name="revolute_base_collision02">
            <geometry>
                <box>
                    <size>0.01 0.02 1.5</size>
                </box>
            </geometry>
        </collision>
        <!-- Same geometry as collision -->
        <!--<visual name="revolute_base_visual02">
            <geometry>
                <box>
                    <size>0.01 0.02 1.5</size>
                </box>
            </geometry>
        </visual>  -->
    </link>

    <joint name="revolute_base_to_heavy_base02" type="fixed">
        <parent>heavy_base01</parent>
        <child>revolute_base02</child>
    </joint>

    <link name="revolute_arm01">
    <!-- Put ...
(more)
edit retag flag offensive close merge delete