Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Missing transformations in Rviz

link text

And i dont know how to connect other links to chassis

Missing transformations in Rviz

link text

And i dont know how to connect other links to chassis

urdf file is properly formed, gazebo file is not, says:

Error: No name given for the robot. at line 89 in /build/urdfdom-ACOcA8/urdfdom-1.0.0/urdf_parser/src/model.cpp ERROR: Model Parsing the xml failed

gazebo code:

    <?xml version="1.0"?>
<robot>


  <gazebo>
    <plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
      <legacyMode>false</legacyMode>
      <alwaysOn>true</alwaysOn>
      <updateRate>20</updateRate>
      <leftJoint>left_wheel_hinge</leftJoint>
      <rightJoint>right_wheel_hinge</rightJoint>
      <wheelSeparation>0.4</wheelSeparation>
      <wheelDiameter>0.1</wheelDiameter>
      <torque>20</torque>
      <commandTopic>cmd_vel</commandTopic>
      <odometryTopic>odom</odometryTopic>
      <odometryFrame>odom</odometryFrame>
      <robotBaseFrame>chassis</robotBaseFrame>
    </plugin>
  </gazebo>

  <gazebo reference="chassis">
      <material>Gazebo/Orange</material>
    </gazebo>
  <gazebo reference="left_wheel">
      <material>Gazebo/Blue</material>
  </gazebo>
  <gazebo reference="right_wheel">
      <material>Gazebo/Blue</material>
  </gazebo>

  <gazebo reference="camera_link">
  <sensor name="kinect_camera" type="depth">
    <!--update_rate>40</update_rate-->
    <visualize>true</visualize>
    <camera>
      <horizontal_fov>1.047198</horizontal_fov>
      <image>
        <width>640</width>
        <height>480</height>
        <format>R8G8B8</format>
      </image>
      <clip>
        <near>0.1</near>
        <far>100</far>
      </clip>
    </camera>
    <plugin name="kinect_controller" filename="libgazebo_ros_openni_kinect.so">
      <baseline>0.2</baseline>
      <alwaysOn>true</alwaysOn>
      <updateRate>0.0</updateRate>
      <cameraName>kinect_camera_ir</cameraName>
      <imageTopicName>/kinect_camera/image_raw</imageTopicName>
      <cameraInfoTopicName>/kinect_camera/depth/camera_info</cameraInfoTopicName>
      <depthImageTopicName>/kinect_camera/depth/image_raw</depthImageTopicName>
      <depthImageInfoTopicName>/kinect_camera/depth/camera_info</depthImageInfoTopicName>
      <pointCloudTopicName>/kinect_camera/depth/points</pointCloudTopicName>
      <frameName>kinect_frame</frameName>
      <pointCloudCutoff>0.5</pointCloudCutoff>
      <pointCloudCutoffMax>3.0</pointCloudCutoffMax>
      <distortionK1>0</distortionK1>
      <distortionK2>0</distortionK2>
      <distortionK3>0</distortionK3>
      <distortionT1>0</distortionT1>
      <distortionT2>0</distortionT2>
      <CxPrime>0</CxPrime>
      <Cx>0</Cx>
      <Cy>0</Cy>
      <focalLength>0</focalLength>
      <hackBaseline>0</hackBaseline>
    </plugin>
  </sensor>
</gazebo>
</robot>

Missing transformations in Rviz

link text

And i dont know how to connect other links to chassis

urdf file is properly formed, gazebo file is not, says:

Error: No name given for the robot. at line 89 in /build/urdfdom-ACOcA8/urdfdom-1.0.0/urdf_parser/src/model.cpp ERROR: Model Parsing the xml failed

gazebo code:

    <?xml version="1.0"?>
<robot>


  <gazebo>
    <plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
      <legacyMode>false</legacyMode>
      <alwaysOn>true</alwaysOn>
      <updateRate>20</updateRate>
      <leftJoint>left_wheel_hinge</leftJoint>
      <rightJoint>right_wheel_hinge</rightJoint>
      <wheelSeparation>0.4</wheelSeparation>
      <wheelDiameter>0.1</wheelDiameter>
      <torque>20</torque>
      <commandTopic>cmd_vel</commandTopic>
      <odometryTopic>odom</odometryTopic>
      <odometryFrame>odom</odometryFrame>
      <robotBaseFrame>chassis</robotBaseFrame>
    </plugin>
  </gazebo>

  <gazebo reference="chassis">
      <material>Gazebo/Orange</material>
    </gazebo>
  <gazebo reference="left_wheel">
      <material>Gazebo/Blue</material>
  </gazebo>
  <gazebo reference="right_wheel">
      <material>Gazebo/Blue</material>
  </gazebo>

  <gazebo reference="camera_link">
  <sensor name="kinect_camera" type="depth">
    <!--update_rate>40</update_rate-->
    <visualize>true</visualize>
    <camera>
      <horizontal_fov>1.047198</horizontal_fov>
      <image>
        <width>640</width>
        <height>480</height>
        <format>R8G8B8</format>
      </image>
      <clip>
        <near>0.1</near>
        <far>100</far>
      </clip>
    </camera>
    <plugin name="kinect_controller" filename="libgazebo_ros_openni_kinect.so">
      <baseline>0.2</baseline>
      <alwaysOn>true</alwaysOn>
      <updateRate>0.0</updateRate>
      <cameraName>kinect_camera_ir</cameraName>
      <imageTopicName>/kinect_camera/image_raw</imageTopicName>
      <cameraInfoTopicName>/kinect_camera/depth/camera_info</cameraInfoTopicName>
      <depthImageTopicName>/kinect_camera/depth/image_raw</depthImageTopicName>
      <depthImageInfoTopicName>/kinect_camera/depth/camera_info</depthImageInfoTopicName>
      <pointCloudTopicName>/kinect_camera/depth/points</pointCloudTopicName>
      <frameName>kinect_frame</frameName>
      <pointCloudCutoff>0.5</pointCloudCutoff>
      <pointCloudCutoffMax>3.0</pointCloudCutoffMax>
      <distortionK1>0</distortionK1>
      <distortionK2>0</distortionK2>
      <distortionK3>0</distortionK3>
      <distortionT1>0</distortionT1>
      <distortionT2>0</distortionT2>
      <CxPrime>0</CxPrime>
      <Cx>0</Cx>
      <Cy>0</Cy>
      <focalLength>0</focalLength>
      <hackBaseline>0</hackBaseline>
    </plugin>
  </sensor>
</gazebo>
</robot>

xacro file:

<?xml version='1.0'?>

<robot name="myrobot" 

    xmlns:xi="http://www.w3.org/2001/XInclude"
    xmlns:gazebo="http://playerstage.sourceforge.net/gazebo/xmlschema/#gz"
    xmlns:model="http://playerstage.sourceforge.net/gazebo/xmlschema/#model"
    xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
    xmlns:body="http://playerstage.sourceforge.net/gazebo/xmlschema/#body"
    xmlns:geom="http://playerstage.sourceforge.net/gazebo/xmlschema/#geom"
    xmlns:joint="http://playerstage.sourceforge.net/gazebo/xmlschema/#joint"
    xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
    xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
    xmlns:rendering="http://playerstage.sourceforge.net/gazebo/xmlschema/#rendering"
    xmlns:renderable="http://playerstage.sourceforge.net/gazebo/xmlschema/#renderable"
    xmlns:physics="http://playerstage.sourceforge.net/gazebo/xmlschema/#physics"
    xmlns:xacro="http://ros.org/wiki/xacro">



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


  <link name='chassis'>
    <pose>0 0 0.1 0 0 0</pose>

    <inertial>
      <mass value="10.0"/>
      <origin xyz="0.0 0 0.1" rpy=" 0 0 0"/>
      <inertia
          ixx="0.5" ixy="0" ixz="0"
          iyy="1.0" iyz="0"
          izz="0.1" />

    </inertial>

    <collision name='collision'>
      <geometry>
        <cylinder radius=".3" length="0.1"/>
      </geometry>
    </collision>

    <visual name='chassis_visual'>
      <origin xyz="0 0 0" rpy=" 0 0 0"/>
      <geometry>
        <cylinder radius=".3" length ="0.1"/>
      </geometry>
    </visual>


    <collision name='caster_collision'>
      <origin xyz="-0.2 0 -0.05" rpy=" 0 0 0"/>
      <geometry>
        <sphere radius="0.05"/>
      </geometry>
      <surface>
        <friction>
          <ode>
            <mu>0</mu>
            <mu2>0</mu2>
            <slip1>1.0</slip1>
            <slip2>1.0</slip2>
          </ode>
        </friction>
      </surface>
    </collision>

    <visual name='caster_visual'>
      <origin xyz="-0.2 0 -0.05" rpy=" 0 0 0"/>
      <geometry>
        <sphere radius="0.05"/>
      </geometry>
    </visual>

    <collision name='caster2_collision'>
      <origin xyz="0.2 0 -0.05" rpy=" 0 0 0"/>
      <geometry>
        <sphere radius="0.05"/>
      </geometry>
      <surface>
        <friction>
          <ode>
            <mu>0</mu>
            <mu2>0</mu2>
            <slip1>1.0</slip1>
            <slip2>1.0</slip2>
          </ode>
        </friction>
      </surface>
    </collision>

    <visual name='caster2_visual'>
      <origin xyz="0.2 0 -0.05" rpy=" 0 0 0"/>
      <geometry>
        <sphere radius="0.05"/>
      </geometry>
    </visual>
  </link>


  <link name="left_wheel">
    <origin xyz="0.1 0.13 0.1" rpy="0 1.5707 1.5707"/>
    <collision name="collision">
      <origin xyz="0 0 0.0" rpy="0 1.5707 1.5707"/>
      <geometry>
        <cylinder radius="0.1" length="0.05"/>
      </geometry>
    </collision>
    <visual name="left_wheel_visual">
      <origin xyz="0 0 0.0" rpy="0 1.5707 1.5707"/>
      <geometry>
        <cylinder radius="0.1" length="0.05"/>
      </geometry>
    </visual>
    <inertial>
      <origin xyz="0 0 0.0" rpy="0 1.5707 1.5707"/>
      <mass value="5"/>
      <cylinder_inertia m="5" r="0.1" h="0.05"/>
      <inertia
        ixx="1.0" ixy="0.0" ixz="0.0"
        iyy="1.0" iyz="0.0"
        izz="1.0"/>
    </inertial>
  </link>

  <link name="right_wheel">
    <origin xyz="0.1 -0.13 0.1" rpy="0 1.5707 1.5707"/>
    <collision name="collision">
      <origin xyz="0 0 0.0" rpy="0 1.5707 1.5707"/>
      <geometry>
        <cylinder radius="0.1" length="0.05"/>
      </geometry>
    </collision>
    <visual name="right_wheel_visual">
      <origin xyz="0 0 0.0" rpy="0 1.5707 1.5707"/>
      <geometry>
        <cylinder radius="0.1" length="0.05"/>
      </geometry>
    </visual>
    <inertial>
      <origin xyz="0 0 0.0" rpy="0 1.5707 1.5707"/>
      <mass value="5"/>
      <cylinder_inertia m="5" r="0.1" h="0.05"/>
      <inertia
        ixx="1.0" ixy="0.0" ixz="0.0"
        iyy="1.0" iyz="0.0"
        izz="1.0"/>
    </inertial>
  </link>


  <joint type="continuous" name="left_wheel_hinge">
    <origin xyz="0.0 -0.29 0" rpy="0 0 0"/>
    <child link="left_wheel"/>
    <parent link="chassis"/>
    <axis xyz="0 1 0" rpy="0 0 0"/>
    <limit effort="100" velocity="100"/>
    <joint_properties damping="0.0" friction="0.0"/>
  </joint>

  <joint type="continuous" name="right_wheel_hinge">
    <origin xyz="0.0 0.29 0" rpy="0 0 0"/>
    <child link="right_wheel"/>
    <parent link="chassis"/>
    <axis xyz="0 1 0" rpy="0 0 0"/>
    <limit effort="100" velocity="100"/>
    <joint_properties damping="0.0" friction="0.0"/>
  </joint>
 <joint name="base_camera_joint" type="fixed">
    <origin xyz="0.2 0 0.1" rpy="0 0 0 " />
    <parent link="chassis" />
    <origin xyz="0 0 0" rpy="0 0 0" />
    <child link="camera_link" />
  </joint>

  <link name="camera_link">
    <inertial>
      <mass value="0.01" />
      <origin xyz="0 0 0" />
      <inertia ixx="0.001" ixy="0.0" ixz="0.0"
        iyy="0.001" iyz="0.0"
        izz="0.001" />
    </inertial>

    <visual>
      <origin xyz=" 0 0 0 " rpy="0 0 0" />
      <geometry>
        <mesh filename="package://mybot_description/meshes/kinect.dae"/>
      </geometry>
    </visual>

    <collision>
      <origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
      <geometry>
        <box size="0.0730 .2760 0.0720"/>
      </geometry>
    </collision>

  </link>

  <joint name="camera_depth_joint" type="fixed">
    <origin xyz="0 0.011 0" rpy="0 0 0" />
    <parent link="camera_link" />
    <child link="camera_depth_frame" />
  </joint>

  <link name="camera_depth_frame">
    <inertial>
      <mass value="0.01" />
      <origin xyz="0 0 0" />
      <inertia ixx="0.001" ixy="0.0" ixz="0.0"
        iyy="0.001" iyz="0.0"
        izz="0.001" />
    </inertial>
  </link>

  <joint name="camera_depth_optical_joint" type="fixed">
    <origin xyz="0 0 0" rpy="1.5707 0 1.5707" />
    <parent link="camera_depth_frame" />
    <child link="camera_depth_optical_frame" />
  </joint>

  <link name="camera_depth_optical_frame">
    <inertial>
      <mass value="0.001" />
      <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>

  <joint name="camera_rgb_joint" type="fixed">
    <origin xyz="0 -0.012 0" rpy="0 0 0" />
    <parent link="camera_link" />
    <child link="camera_rgb_frame" />
  </joint>

  <link name="camera_rgb_frame">
    <inertial>
      <mass value="0.001" />
      <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>

  <joint name="camera_rgb_optical_joint" type="fixed">
    <origin xyz="0 0 0" rpy="1.5707 0 1.5707" />
    <parent link="camera_rgb_frame" />
    <child link="camera_rgb_optical_frame" />
  </joint>

  <link name="camera_rgb_optical_frame">
    <inertial>
      <mass value="0.001" />
      <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>




</robot>