ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Is this a way to call xacro macro?

asked 2020-06-18 09:14:57 -0500

drtritm gravatar image

updated 2020-06-18 09:41:40 -0500

gvdhoorn gravatar image

Hi everyone, I find some files in this source. And I want to fully understand this source. I found this line and I don't know if it is a way to use xacro macro. Because as far as I know that the way to use it is to declare xacro and then call it using the "xacro: (name of macro) " like the following xml

<xacro:macro name="pr2_caster" params="suffix *origin **content **anothercontent">
  <joint name="caster_${suffix}_joint">
    <axis xyz="0 0 1" />
  </joint>
  <link name="caster_${suffix}">
    <xacro:insert_block name="origin" />
    <xacro:insert_block name="content" />
    <xacro:insert_block name="anothercontent" />
  </link>
</xacro:macro>

<xacro:pr2_caster suffix="front_left">
  <pose xyz="0 1 0" rpy="0 0 0" />
  <container>
    <color name="yellow"/>
    <mass>0.1</mass>
  </container>
  <another>
    <inertial>
      <origin xyz="0 0 0.5" rpy="0 0 0"/>
      <mass value="1"/>
      <inertia ixx="100"  ixy="0"  ixz="0" iyy="100" iyz="0" izz="100" />
    </inertial>
  </another>
</xacro:pr2_caster>

But in my files, I see the author write like this

<xacro:macro name="sensor_kinect" params="parent">
<turtlebot_sim_3dsensor/>                              
</xacro:macro>

The turtlebot_sim_3dsensor is a macro define in another file, but I don't know if this is a way to call macro. I think it should be xacro:turtlebot_sim_3dsensor . And the file declaring this macro is not run, how the ROS know that there is this macro? Sorry for my english and I don't know why my code didn't displayed correctly

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-06-18 12:26:41 -0500

David Lu gravatar image

That seems like an error by the author, but what material are you using?

edit flag offensive delete link more

Comments

chefbot- which is a modified of turtlebot

drtritm gravatar image drtritm  ( 2020-06-22 14:00:58 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-06-18 09:14:57 -0500

Seen: 187 times

Last updated: Jun 18 '20