xacro编写程序出错 有没有大佬帮忙看下

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


 <material name="white">
        <color rgba="1 1 1 1"/>
 </material>


 <material name="black">
        <color rgba="0 0 0 1"/>
 </material>


 <material name="gray">
 <color rgba="0.75 0.75 0.75 1"/>
 </material>


 <material name="yellow">
 <color rgba="1 0.4 0 1"/>
 </material>


 <xacro:property name="M_PI" value="3.1415926535897931" />


<!--base-->
 <xacro:property name="base_mass" value="0.5"/>
 <xacro:property name="base_length" value="0.27"/>
 <xacro:property name="base_width" value="0.2"/>
 <xacro:property name="base_height" value="0.075"/>




<!--wheel-->
 <xacro:property name="wheel_mass" value="0.1"/>
 <xacro:property name="wheel_radius" value="0.035"/>
 <xacro:property name="wheel_length" value="0.025"/>
 <xacro:property name="wheel_joint_x" value="0.08"/>
 <xacro:property name="wheel_joint_y" value="0.0875"/>
 <xacro:property name="wheel_joint_z" value="0.0175"/>
 


<!--motor-->
 <macro:property name="motor_mass" value="0.2"/>
 <macro:property name="motor_radius" value="0.02"/>
 <macro:property name="motor_length" value="0.05"/>
 <macro:property name="motor_joint_x" value="0.08"/>
 <macro:property name="motor_joint_y" value="0.0375"/>
 <xacro:property name="wheel_joint_z" value="0.0175"/>








<!--macro for car wheel-->
 <xacro:macro name="wheel" params="prefix1 prefix2 reflect1 reflect2">  
     <joint name="${prefix1}_${prefix2}_wheel_joint" type="continuous">
      <origin xyz="${reflect1*wheel_joint_x} ${reflect2*wheel_joint_y} ${wheel_joint_Z}"/>
 <parent link="${prefix3}_${prefix4}_motor_link"/>
 <child link="${prefix1}_${prefix2}_wheel_link"/>
 <axis xyz="0 1 0"/>
     </joint>




     <link name="${prefix1}_${prefix2}_wheel_link">
 <visual>
             <origin xyz="0 0 0" rpy="${M_PI/2} 0 0"/>
     <geometry>
 <cylinder radius="${wheel_radius}" length="${wheel_length}"/>
     </geometry>
     <material name="black"/>
 </visual>
     </link>
 </xacro:macro>




<!--macro for motor-->
 <xacro:macro name="motor" params="prefix3 prefix4 reflect3 reflect4">
     <joint name="${prefix3}_${prefix4}_motor_joint" type="fixed">
       <origin xyz="${reflect3*motor_joint_x} ${reflect4*motor_joint_y} ${motor_joint_z}"/>
 <parent link="base_link"/>
 <child link="{prefix1}_${prefix2}_motor_link"/>
     </joint>


     <link name="{prefix3}_${prefix4}_motor_link">
 <visual>
     <origin xyz="0 0 0" rpy="${M_PI/2} 0 0"/>
     <geometry>
 <cylinder radius="${motor_radius}" length="motor_length"/>
     </geometry>
     <material name="gray"/>
 </visual>
     </link>
 </xacro:macro>


<!--macro for base-->
 
<xacro:macro name="car_base">


            <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>
            </link>


     <joint name="base_foot_joint" type="fixed">
      <origin xyz="0 0 ${base_length/2+wheel_radius}" rpy="0 0 0"/>
      <parent link="base_footprint"/>
      <child link="base_link"/>
      </joint>
    




     <link name="base_link">
 <visual>
     <origin xyz="0 0 0" rpy="0 0 0"/>
     <geometry>
 <box size="${base_length} ${base_width} ${base_heigth}"/>
     </geometry>
     <material name="white"/>
 </visual>
     </link>




 






 <wheel prefix1="left" prefix2="front" reflect1="1" reflect2="1"/>
 <wheel prefix1="left" prefix2="behind" reflec1="-1" reflect2="1"/>
 <wheel prefix1="right" prefix2="front" reflect1="1" reflect2="-1"/>
 <wheel prefix1="right" prefix2="behind" reflect1="-1" reflect2="-1"/>


 <motor prefix3="left" prefix4="front" reflect3="1" reflect4="1"/>
 <motor prefix3="left" prefix4="behind" reflect3="-1" reflect4="1"/>
 <motor prefix3="right" prefix4="front" reflect3="1" reflect4="-1"/>
 <motor prefix3="right" prefix4="behind" reflect3="-1" reflect4="-1"/>
      












































</robot>


错误显示:
XML parsing error: unbound prefix: line 39, column 1
when processing file: /home/liuzihanbot/catkin_ws/src/smartcar308s_description/urdf/xacro/308s_body.xacro
included from: smartcar.xacro


Check that:
 - Your XML is well-formed
 - You have the xacro xmlns declaration: xmlns:xacro="http://www.ros.org/wiki/xacro"

17861406200 原型机 沙发

2019-05-10 19:14

菜鸟到此一游
游客
登录后才可以回帖,登录 或者 注册