ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Is this a way to call xacro macro?

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

drtritm gravatar image

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

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" />
  <link name="caster_${suffix}">
    <xacro:insert_block name="origin" />
    <xacro:insert_block name="content" />
    <xacro:insert_block name="anothercontent" />

<xacro:pr2_caster suffix="front_left">
  <pose xyz="0 1 0" rpy="0 0 0" />
    <color name="yellow"/>
      <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" />

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

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

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

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

David Lu gravatar image

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

edit flag offensive delete link more


chefbot- which is a modified of turtlebot

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


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

Seen: 102 times

Last updated: Jun 18 '20