Gazebo does not read the .xacro

asked 2021-08-18 18:29:21 -0600

martinuacm gravatar image

Hello I hope you can help me.

Performing the following tutorial:

https://programmerclick.com/article/1...

Everything is fine, but when I have to run Gazebo to see the chassis, I don't see anything, the chassis does not come out. I continue with the tutorial and I still don't see the robot.

I am using Ubuntu 20.04, ros noetic, and gazebo 11.

These are my .xacro files:

mybot.xacro

    ?xml version="1.0"?>
<robot name="mybot" xmlns:xacro="http://www.ros.org/wiki/xacro">
        <!-- Put here the robot description -->

    <xacro:property name="PI" value="3.1415926535897931"/>
<xacro:property name="chassisHeight" value="0.1"/>
<xacro:property name="chassisLength" value="0.4"/>
<xacro:property name="chassisWidth" value="0.2"/>
<xacro:property name="chassisMass" value="50"/>

<xacro:property name="casterRadius" value="0.05"/>
<xacro:property name="casterMass" value="5"/>

<xacro:property name="wheelWidth" value="0.05"/>
<xacro:property name="wheelRadius" value="0.1"/>    
<xacro:property name="wheelPos" value="0.2"/>
<xacro:property name="wheelMass" value="5"/>

<xacro:property name="cameraSize" value="0.05"/>
<xacro:property name="cameraMass" value="0.1"/>

<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="footprint" />

<joint name="base_joint" type="fixed">
  <parent link="footprint"/>
  <child link="chassis"/>
</joint>

<link name='chassis'>
    <collision> 
            <origin xyz="0 0 ${wheelRadius}" rpy="0 0 0"/> 
            <geometry> 
                <box size="${chassisLength} ${chassisWidth} ${chassisHeight}"/> 
            </geometry> 
    </collision>
    <visual> 
            <origin xyz="0 0 ${wheelRadius}" rpy="0 0 0"/> 
            <geometry> 
                <box size="${chassisLength} ${chassisWidth} ${chassisHeight}"/> 
            </geometry> 
                   <material name="orange"/>
    </visual>
    <inertial> 
            <origin xyz="0 0 ${wheelRadius}" rpy="0 0 0"/> 
            <mass value="${chassisMass}"/> 
            <box_inertia m="${chassisMass}" x="${chassisLength}" y="${chassisWidth}" z="${chassisHeight}"/>
    </inertial>
</link>

<joint name="fixed" type="fixed">
      <parent link="chassis"/>
      <child link="caster_wheel"/>
</joint>

</robot>

mybot.gazebo

<?xml version="1.0"?>

<robot <a="" href="http://xmlns:xacro="http://www.ros.org/wiki/xacro%22" name="mybot">xmlns:xacro="http://www.ros.org/wiki/...> </robot>

    <gazebo reference="chassis">
    <material>Gazebo/Orange</material>
</gazebo>

</robot>

macros.xacro

<?xml version="1.0"?>

<robot <a="" href="http://xmlns:xacro="http://www.ros.org/wiki/xacro%22" name="mybot">xmlns:xacro="http://www.ros.org/wiki/...> </robot>

    <xacro:macro name="cylinder_inertia" params="m r h">
    <inertia  ixx="${m*(3*r*r+h*h)/12}" ixy = "0" ixz = "0"
                  iyy="${m*(3*r*r+h*h)/12}" iyz = "0"
               izz="${m*r*r/2}"
    />
</xacro:macro>

<xacro:macro name="box_inertia" params="m x y z">
    <inertia  ixx="${m*(y*y+z*z)/12}" ixy = "0" ixz = "0"
              iyy="${m*(x*x+z*z)/12}" iyz = "0"
                     izz="${m*(x*x+z*z)/12}"
    /> ...
(more)
edit retag flag offensive close merge delete