Model unaffected by gravity in Gazebo [closed]

asked 2015-05-19 01:08:59 -0600

Cerin gravatar image

Based on the Gazebo ROS Control tutorial, I'm trying to render a model in Gazebo, but it's behaving like a static model unaffected by physics. When I launch the default rrbot model, the arm swings down due to gravity, but with my model, the arm stays fixed and never drops. Why is this?

I'm launching it like:

roslaunch mybot_gazebo mybot_world.launch

My mybot_description/models/mybot.urdf.xacro:

<?xml version="1.0"?>
<robot name="mybot"
    xmlns:xacro="http://www.ros.org/wiki/xacro">

    <xacro:macro name="box_inertia" params="mass x y z">
        <inertia
            ixx="${mass*(y*y+z*z)/12}" ixy="0" ixz="0"
            iyy="${mass*(x*x+z*z)/12}" iyz="0" izz="${mass*(x*x+z*z)/12}" /> 
    </xacro:macro>

    <xacro:include filename="$(find mybot_description)/models/materials.urdf.xacro" />

    <!-- width in meters -->
    <property name="torso_x_size" value="0.1" />

    <!-- length in meters -->
    <property name="torso_y_size" value="0.205" />

    <!-- height in meters -->
    <property name="torso_z_size" value="0.03" />

    <!-- torso mass (not including legs) in kg -->
    <property name="torso_mass" value="0.920" />

    <!-- distance from ground to shoulders when standing at full height -->
    <property name="total_leg_height" value="0.158" />

    <!-- mass of a single upper leg piece in kg -->
    <property name="upper_leg_mass" value="0.010" />

    <property name="upper_leg_depth" value="0.003" />
    <property name="upper_leg_length" value="0.04" />
    <property name="upper_leg_thickness" value="0.005" />

    <link name="base_footprint">
        <visual>
            <origin xyz="0 0 0" rpy="0 0 0" />
            <geometry>
                <box size="0.001 0.001 0.001" />
            </geometry>
        </visual>
        <inertial>
            <mass value="0.0001" />
            <origin xyz="0 0 0" />
            <inertia
                ixx="0.0001" ixy="0.0" ixz="0.0"
                iyy="0.0001" iyz="0.0" izz="0.0001" />
        </inertial>
    </link>
    <gazebo reference="base_footprint">
        <turnGravityOff>false</turnGravityOff>
    </gazebo>

    <joint name="base_footprint_joint" type="fixed">
        <origin xyz="0 0 ${total_leg_height}" rpy="0 0 0" />
        <parent link="base_footprint"/>
        <child link="base_link" />
    </joint>

    <link name="base_link">
        <visual>
            <geometry>
                <box size="${torso_x_size} ${torso_y_size} ${torso_z_size}" />
            </geometry>
            <material name="red"/>
        </visual>
        <collision>
            <geometry>
                <box size="${torso_x_size} ${torso_y_size} ${torso_z_size}" />
            </geometry>
        </collision>
        <inertial>
            <origin xyz="0 0 0" rpy="0 0 0" />
            <mass value="${torso_mass}" />
            <xacro:box_inertia
                mass="${torso_mass}"
                x="${torso_x_size}" y="${torso_y_size}" z="${torso_z_size}" />
        </inertial>
    </link>
    <gazebo reference="base_link">
        <material>Gazebo/Red</material>
        <turnGravityOff>false</turnGravityOff>
    </gazebo>

    <xacro:macro name="leg" params="name reflect_x reflect_y">
        <link name="${name}">
            <visual>
                <geometry>
                    <box size="${upper_leg_depth} ${upper_leg_length} ${upper_leg_thickness}" />
                </geometry>
                <origin xyz="${upper_leg_depth/2*reflect_x} ${upper_leg_length/2} 0" rpy="0 0 0"/>
                <material name="blue" />
            </visual>
            <collision>
                <geometry>
                    <box size="${upper_leg_depth} ${upper_leg_length} ${upper_leg_thickness}" />
                </geometry>
                <origin xyz="${upper_leg_depth/2*reflect_x} ${upper_leg_length/2} 0" rpy="0 0 0"/>
            </collision>
            <inertial>
                <origin xyz="0 0 0" rpy="0 0 0" />
                <mass value="${upper_leg_mass}" />
                <xacro:box_inertia
                    mass="${upper_leg_mass}"
                    x="${upper_leg_depth}" y="${upper_leg_length}" z="${upper_leg_thickness}" />
            </inertial>
        </link>

        <gazebo reference="${name}">
            <mu1 value="1.0"/>
            <mu2 value="1.0"/>
            <kp  value="10000000.0" />
            <kd  value="1.0" />
            <fdir1 value="1 0 0"/>
            <material>Gazebo/Blue</material>
            <turnGravityOff>false</turnGravityOff>
        </gazebo>

        <joint name="torso_to_${name}_joint" type="continuous">
            <parent link="base_link"/>
            <child link="${name}"/>
            <origin xyz="${(torso_x_size/2)*reflect_x} ${torso_y_size/2*reflect_y} ${-torso_z_size ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason Gazebo Question: The Gazebo community prefers to answer questions at: http://answers.gazebosim.org by tfoote
close date 2017-03-29 16:50:54.437276