之前一直在跟着古月老师的教程去学习ROS,最开始为了图省事直接下的noetic。在学习URDF文件时发现很多模型都加载不出来例如mrobot小车车。
实际上问题在于新版本中,哪怕是在同一个文件内定义的两个宏。例如xacro:macro name="mrobot_standoff_2in"
xacro:macro name="mrobot_body"
想要让xacro:macro name="mrobot_body"
调用"mrobot_standoff_2in"
的时候还是要加上前缀的
<xacro:mrobot_standoff_2in parent="base_link" number="1" x_loc="-${standoff_x/2 + 0.03}" y_loc="-${standoff_y - 0.03}" z_loc="${plate_height/2}"/>
<xacro:mrobot_standoff_2in parent="base_link" number="2" x_loc="-${standoff_x/2 + 0.03}" y_loc="${standoff_y - 0.03}" z_loc="${plate_height/2}"/>
<xacro:mrobot_standoff_2in parent="base_link" number="3" x_loc="${standoff_x/2}" y_loc="-${standoff_y}" z_loc="${plate_height/2}"/>
<xacro:mrobot_standoff_2in parent="base_link" number="4" x_loc="${standoff_x/2}" y_loc="${standoff_y}" z_loc="${plate_height/2}"/>