specify link as joint to world in urdf

asked 2017-01-07 20:31:46 -0500

dinesh gravatar image

updated 2017-01-07 20:32:52 -0500

When ever i launch my urdf velodyne sensor in gazebo, it starts to rotate and than it vanishes in the world by jumping from one place to another. I tried to apply similar method as in gazebo but seems like in xacro file it donot worlks. i.e i cant keep the velodyne base link only fixed with the ground. I also used

<gazebo>
  <static>true</static>
</gazebo>

in my xacro file, but the hole velodyne is not rotating after this, the top link has to rotate. Than i tried below code which works for sdf file, but it is not working for xacro file:

       <gazebo>
         <joint name="joint_2" type="revolute">
           <parent link="world"/>
           <child link="base"/>
         </joint>
       </gazebo>

I inserted <gazebo> element so that gazebo will know the element world in parent link. My full xacro file of velodyne sensor is:

<?xml version="1.0"?>
<robot name="laser" xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:include filename="$(find myrobot1_description)/urdf/laser.gazebo" />
<xacro:include filename="$(find myrobot1_description)/urdf/materials.xacro" />

  <link name="base">

    <visual>
      <origin rpy="0 0 0" xyz="0 0 0.078335"/>
      <geometry>
        <mesh filename="package://myrobot1_description/meshes/velodyne_base.dae"/>
      </geometry>
      <material name="orange"/>
    </visual>

    <collision>
      <origin rpy="0 0 0" xyz="0 0 0.078335"/>
      <geometry>
        <mesh filename="package://myrobot1_description/meshes/velodyne_base.dae"/>
      </geometry>
    </collision>

    <inertial>
      <origin rpy="0 0 0" xyz="0 0 0.078335"/>
      <mass value="0.5"/>
      <inertia ixx="0.000090623" ixy="0.0" ixz="0.0" iyy="0.000090623" iyz="0.0" izz="0.000091036"/>
    </inertial>

  </link>

  <link name="top">
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://myrobot1_description/meshes/velodyne_top.dae"/>
      </geometry>
      <material name="orange"/>
    </visual>

    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://myrobot1_description/meshes/velodyne_top.dae"/>
      </geometry>
    </collision>

    <inertial>
      <mass value="0.5"/>
      <inertia ixx="0.000090623" ixy="0.0" ixz="0.0" iyy="0.000090623" iyz="0.0" izz="0.000091036"/>
    </inertial>
  </link>

  <joint name="joint_1" type="revolute">
    <origin rpy="0 0 0" xyz="0 0 0.077"/>
    <axis xyz="0 0 1"/>
    <limit effort="1000.0" lower="-10000000000000000" upper="10000000000000000" velocity="0.5"/>
    <parent link="base"/>
    <child link="top"/>
  </joint>

   <gazebo>
     <joint name="joint_2" type="revolute">
       <parent link="world"/>
       <child link="base"/>
     </joint>
   </gazebo>

  <transmission name="tran1">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint_1">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor1">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

</robot>

So how can i remove this problem. What i want is when i launch this file, i dont want my velodyne sensor to jump cas of rotation and stay in one place.

edit retag flag offensive close merge delete