Robotics StackExchange | Archived questions

Why robot strangely action in gazebo world?

i wrote URDF.xacro file and showed robot in gazebo world but Big wheels rotate continuously despite i don't any actions.and model is tremble what's the problems? your answer is support gazebo simulations thanks.

here is my launch file

<launch>

  <!-- these are the arguments you can pass this launch file, for example paused:=true -->
  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="model" value="$(find rnd_description)/urdf/test.xacro"/>
 <!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="debug" value="$(arg debug)" />
    <arg name="gui" value="$(arg gui)" />
    <arg name="paused" value="$(arg paused)"/>
    <arg name="use_sim_time" value="$(arg use_sim_time)"/>
    <arg name="headless" value="$(arg headless)"/>
  </include>

<!-- Load the URDF into the ROS Parameter Server -->
  <param name="robot_description" command="$(find xacro)/xacro.py '$(arg model)'" />
  <param name="publish_frequency" type="double" value="50.0"/>

<!-- Run a python script to the send a service call to gazebo_ros to spawn a URDF robot -->
   <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher"/>
   <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher">
     <param name="publish_frequency" type="double" value="50.0"/>
   </node>

    <node name="spawn_robot" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen"
    args="-urdf -param robot_description -model robot_model"/>

    <node name="joy_node" pkg="joy" type="joy_node"/>
    <node name="teleop_joy" pkg="teleop_joy" type="teleop_joy"/>

</launch>

here is my urdf file

<?xml version="1.0"?>

 <!-- Used for fixing robot to Gazebo 'base_link' -->
  <link name="world"/>

  <joint name="fixed" type="fixed">
    <parent link="world"/>
    <child link="base_link"/>
  </joint>

<!-- Used for fixing robot to Gazebo 'base_link' -->

<!--*******************base_link********************-->
 <link name="base_link">
     <visual>
       <geometry>
         <box size="0.68 0.9 .28"/>
       </geometry>  
        <origin rpy="0 0 0" xyz="0 0 0"/>
        <material name="black">
        <color rgba="1 1 1 1"/>
        </material>
      </visual>

        <collision>
           <geometry>
        <box size="0.68 0.9 .28"/>
           </geometry>
        </collision>

      <inertial>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <mass value="100"/>
            <inertia
          ixx="7.4" ixy="0.0" ixz="0.0"
          iyx="0.0" iyy="4.51" iyz="0.0"
          izx="0.0" izy="0.0" izz="10.6"/>
          </inertial>
  </link>
<!--*************************************************-->


<!--*******************Black_Deck********************-->
    <link name="Black_Deck">
        <visual>
           <geometry>
             <box size="0.6 0.6 .07"/>
       </geometry>  
             <origin rpy="0 0 0" xyz="0 0 0.17"/>
             <material name="black">
              <color rgba="0 0 0 1"/>
             </material>
         </visual>

      <collision>
        <geometry>
     <box size="0.68 0.9 .28"/>
        </geometry>
       </collision>

    </link>

      <joint name="base_to_Black_Deck" type="fixed">
         <parent link="base_link"/>
         <child link="Black_Deck"/>
         <origin xyz="0 0 0"/>
      </joint>

<!--********************************************************-->


<!--*******************Laser_Sensor*************************-->

      <link name="laser">
         <visual>
            <geometry>
              <mesh filename="package://rnd_description/meshes/hokuyo.dae" />
        </geometry> 
            <origin rpy="0 0 0" xyz="0 0 0"/>
             <material name="black">
               <color rgba="0 0 0 1"/>
             </material>
         </visual>

    </link>

     <joint name="base_to_hokuyo" type="fixed">
         <parent link="base_link"/>
         <child link="laser"/>
         <origin rpy="3.141592 0 1.57" xyz="0 0.46 -0.105"/>
      </joint>

<!--********************************************************-->

<!--*******************Front_Bar*************************-->

    <link name="Front_Bar">
           <visual>
            <geometry>
               <box size="0.68 0.01 0.07"/>
         </geometry>    
              <origin rpy="0 0 0" xyz="0 0.455 0.105"/>
              <material name="black">
              <color rgba="0.1 0.3 0 1"/>
            </material>
           </visual>

    <collision>
         <geometry>
      <box size="0.68 0.01 0.07"/>
         </geometry>
        </collision>

     </link>

    <joint name="base_to_Front_Bar" type="fixed">
         <parent link="base_link"/>
         <child link="Front_Bar"/>
         <origin xyz="0 0 0"/>
        </joint>

<!--********************************************************-->

<!--*******************Back_Bar*************************-->

    <link name="Back_Bar">
           <visual>
            <geometry>
               <box size="0.68 0.01 0.07"/>
        </geometry> 
            <origin rpy="0 0 0" xyz="0 -0.455 0.105"/>
            <material name="black">
               <color rgba="0.1 0.3 0 1"/>
            </material>
          </visual>

        <collision>
             <geometry>
          <box size="0.68 0.01 0.07"/>
             </geometry>
            </collision>

     </link>

    <joint name="base_to_Back_Bar" type="fixed">
         <parent link="base_link"/>
         <child link="Back_Bar"/>
         <origin xyz="0 0 0"/>
        </joint>

<!--********************************************************-->

<!--*******************Big_Wheel********************-->
   <link name="wheel_right">
      <visual>
        <geometry>
          <cylinder length="0.08" radius="0.125"/>
     </geometry>    
         <origin rpy="0 1.555 0" xyz="0 0 0"/>
         <material name="black">
          <color rgba="0 0 0 1"/>
         </material>
       </visual>

        <collision>
             <geometry>
          <cylinder length="0.08" radius="0.125"/>
             </geometry>
        <origin rpy="0 1.555 0" xyz="0 0 0"/>
            </collision>

       <inertial>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <mass value="3"/>
           <inertia
          ixx="0.0234" ixy="0.0" ixz="0.0"
          iyx="0.0" iyy="0.01332" iyz="0.0"
          izx="0.0" izy="0.0" izz="0.01332"/>
            </inertial>     
     </link>

      <joint name="base_to_wheel_right" type="continuous">
         <parent link="base_link"/>
         <child link="wheel_right"/>
         <origin rpy="0 0 -3.128" xyz="0.38 0 -0.0615"/>
      </joint>

      <link name="wheel_left">
         <visual>
            <geometry>
               <cylinder length="0.08" radius="0.125"/>
        </geometry> 
             <origin rpy="0 1.555 0" xyz="0 0 0"/>
             <material name="black">
               <color rgba="0 0 0 1"/>
             </material>
         </visual>

        <collision>
             <geometry>
           <cylinder length="0.08" radius="0.125"/>
             </geometry>
        <origin rpy="0 1.555 0" xyz="0 0 0"/>
            </collision>

       <inertial>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <mass value="3"/>
            <inertia
          ixx="0.0234" ixy="0.0" ixz="0.0"
          iyx="0.0" iyy="0.01332" iyz="0.0"
          izx="0.0" izy="0.0" izz="0.01332"/>
            </inertial>       

    </link>

      <joint name="base_to_wheel_left" type="continuous">
         <parent link="base_link"/>
         <child link="wheel_left"/>
         <origin rpy="0 0 -3.128" xyz="-0.38 0 -0.0615"/>
      </joint>
<!--*****************************************************************-->

<!--*******************Small_Wheel********************-->
     <link name="static_wheel_1">
         <visual>
            <geometry>
               <cylinder length="0.09" radius="0.06"/>
        </geometry> 
            <origin rpy="0 1.555 0" xyz="0 0 0"/>
            <material name="black">
               <color rgba="0 0 0 1"/>
            </material>
      </visual>

        <collision>
             <geometry>
          <cylinder length="0.09" radius="0.06"/>
             </geometry>
        <origin rpy="0 1.555 0" xyz="0 0 0"/>
            </collision>

       <inertial>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <mass value="1"/>
            <inertia
          ixx="0.0018" ixy="0.0" ixz="0.0"
          iyx="0.0" iyy="0.0015" iyz="0.0"
          izx="0.0" izy="0.0" izz="0.0015"/>
            </inertial>     
      </link>

      <joint name="base_to_static_wheel_1" type="fixed">
         <parent link="base_link"/>
         <child link="static_wheel_1"/>
         <origin rpy="0 0 -3.128" xyz="0.385 0.4 -0.13"/>
      </joint>

      <link name="static_wheel_2">
         <visual>
            <geometry>
              <cylinder length="0.09" radius="0.06"/>
        </geometry> 
            <origin rpy="0 1.555 0" xyz="0 0 0"/>
            <material name="black">
              <color rgba="0 0 0 1"/>
            </material>
         </visual>
        <collision>
             <geometry>
          <cylinder length="0.09" radius="0.06"/>
             </geometry>
        <origin rpy="0 1.555 0" xyz="0 0 0"/>
            </collision>

       <inertial>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <mass value="1"/>
            <inertia
          ixx="0.0018" ixy="0.0" ixz="0.0"
          iyx="0.0" iyy="0.0015" iyz="0.0"
          izx="0.0" izy="0.0" izz="0.0015"/>
            </inertial>         
      </link>

      <joint name="base_to_static_wheel_2" type="fixed">
         <parent link="base_link"/>
         <child link="static_wheel_2"/>
         <origin rpy="0 0 -3.128" xyz="-0.385 0.4 -0.13"/>
      </joint>

    <link name="static_wheel_3">
         <visual>
          <geometry>
             <cylinder length="0.09" radius="0.06"/>
       </geometry>  
           <origin rpy="0 1.555 0" xyz="0 0 0"/>
           <material name="black">
            <color rgba="0 0 0 1"/>
           </material>
         </visual>

        <collision>
             <geometry>
          <cylinder length="0.09" radius="0.06"/>
             </geometry>
        <origin rpy="0 1.555 0" xyz="0 0 0"/>
            </collision>

       <inertial>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <mass value="1"/>
             <inertia
          ixx="0.0018" ixy="0.0" ixz="0.0"
          iyx="0.0" iyy="0.0015" iyz="0.0"
          izx="0.0" izy="0.0" izz="0.0015"/>
            </inertial>     
     </link>

     <joint name="base_to_static_wheel_3" type="fixed">
         <parent link="base_link"/>
         <child link="static_wheel_3"/>
         <origin rpy="0 0 -3.128" xyz="0.38 -0.4 -0.13"/>
      </joint>

      <link name="static_wheel_4">
         <visual>
            <geometry>
              <cylinder length="0.09" radius="0.06"/>
        </geometry> 
            <origin rpy="0 1.555 0" xyz="0 0 0"/>
            <material name="black">
               <color rgba="0 0 0 1"/>
            </material>
         </visual>

       <collision>
             <geometry>
         <cylinder length="0.09" radius="0.06"/>
             </geometry>
        <origin rpy="0 1.555 0" xyz="0 0 0"/>
            </collision>

       <inertial>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <mass value="1"/>
            <inertia
          ixx="0.0018" ixy="0.0" ixz="0.0"
          iyx="0.0" iyy="0.0015" iyz="0.0"
          izx="0.0" izy="0.0" izz="0.0015"/>
            </inertial>     
     </link>

      <joint name="base_to_static_wheel_4" type="fixed">
         <parent link="base_link"/>

         <child link="static_wheel_4"/>
         <origin rpy="0 0 -3.128" xyz="-0.38 -0.4 -0.13"/>
      </joint>


<!--*****************************************************************-->

<!--***************************Light**********************************-->
     <link name="Front_Light_1">

    <visual>
          <geometry>
            <cylinder length="0.01" radius="0.03"/>
      </geometry>   
          <origin rpy="1.555 0 0" xyz="0.28 0.465 0.105"/>
          <material name="white">
             <color rgba="0 0 0 1"/>
          </material>
         </visual>

     </link>

     <joint name="base_to_Front_Light_1" type="fixed">
          <parent link="base_link"/>
          <child link="Front_Light_1"/>
          <origin rpy="0 0 0" xyz="0 0 0"/>
         </joint>

      <link name="Front_Light_2">
         <visual>
            <geometry>
              <cylinder length="0.01" radius="0.03"/>
        </geometry> 
            <origin rpy="1.555 0 0" xyz="0.19 0.465 0.105"/>
            <material name="white">
             <color rgba="1 0 0 1"/>
            </material>
         </visual>

      </link>

      <joint name="base_to_Front_Light_2" type="fixed">
         <parent link="base_link"/>
         <child link="Front_Light_2"/>
         <origin rpy="0 0 0" xyz="0 0 0"/>
      </joint>

       <link name="Front_Light_3">
          <visual>
            <geometry>
               <cylinder length="0.01" radius="0.03"/>
        </geometry> 
            <origin rpy="1.555 0 0" xyz="-0.28 0.465 0.105"/>
            <material name="white">
               <color rgba="0 0 0 1"/>
            </material>
         </visual>

    </link>

      <joint name="base_to_Front_Light_3" type="fixed">
         <parent link="base_link"/>
         <child link="Front_Light_3"/>
         <origin rpy="0 0 0" xyz="0 0 0"/>
      </joint>

      <link name="Front_Light_4">
         <visual>
           <geometry>
              <cylinder length="0.01" radius="0.03"/>
       </geometry>  
            <origin rpy="1.555 0 0" xyz="-0.19 0.465 0.105"/>
            <material name="white">
               <color rgba="1 0 0 1"/>
            </material>
         </visual>

        </link>

      <joint name="base_to_Front_Light_4" type="fixed">
         <parent link="base_link"/>
         <child link="Front_Light_4"/>
         <origin rpy="0 0 0" xyz="0 0 0"/>
      </joint>
<!--*****************************************************************-->

<!--*******************hokuyo*******************************-->
<gazebo reference="laser">
    <sensor type="ray" name="laser">
      <pose>0 0 0 0 0 0</pose>
      <visualize>true</visualize>
      <update_rate>40</update_rate>
      <ray>
        <scan>
          <horizontal>
            <samples>720</samples>
            <resolution>1</resolution>
            <min_angle>-2.26889</min_angle>
            <max_angle>2.2689</max_angle>
          </horizontal>
        </scan>
        <range>
          <min>0.10</min>
          <max>30.0</max>
          <resolution>0.01</resolution>
        </range>
        <noise>
          <type>gaussian</type>
          <!-- Noise parameters based on published spec for Hokuyo laser
               achieving "+-30mm" accuracy at range < 10m.  A mean of 0.0m and
               stddev of 0.01m will put 99.7% of samples within 0.03m of the true reading. -->
          <mean>0.0</mean>
          <stddev>0.01</stddev>
        </noise>
      </ray>   

     <plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_laser.so">
        <topicName>/scan</topicName>
        <frameName>laser</frameName>
      </plugin> 
    </sensor>
  </gazebo>

<!--*************************************************************-->


<gazebo>
  <plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
    <alwaysOn>true</alwaysOn>
    <updateRate>100.0</updateRate>
    <leftJoint>base_to_wheel_left</leftJoint>
    <rightJoint>base_to_wheel_right</rightJoint>
    <wheelSeparation>0.76</wheelSeparation>
    <wheelDiameter>0.25</wheelDiameter>
    <torque>0</torque>
    <commandTopic>cmd_vel</commandTopic>
    <odometryTopic>odom</odometryTopic>
    <odometryFrame>odom</odometryFrame>
    <robotBaseFrame>base_link</robotBaseFrame>
  </plugin>
</gazebo> 

</robot>

Asked by dj1206 on 2014-08-06 07:22:53 UTC

Comments

Maybe you should ask this question here: http://answers.gazebosim.org/questions/

Asked by BennyRe on 2014-08-06 08:17:02 UTC

Answers