Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

pass parameters of xacro file in another xacro file

I have this cameras.urdf.xacro file:

<?xml version="1.0"?>
<robot name="origins">
     <link name="$(arg tf_prefix_camera1)_pose_frame"/>
     <link name="$(arg tf_prefix_camera2)_link"/>

     <joint name="$(arg tf_prefix_camera1)_to_$(arg tf_prefix_camera2)" type="fixed">
       <parent link="$(arg tf_prefix_camera1)_pose_frame"/>
       <child link="$(arg tf_prefix_camera2)_link"/>
       <origin xyz="0.009 0.021 0.027" rpy="0.000 -0.018 0.005"/>
     </joint>
</robot>

So, this file has parameters tf_prefix_camera1 and tf_prefix_camera2. And i want to include this file in another xacro file and set this parameters. how can i do it?

pass parameters of xacro file in another xacro file

I have this cameras.urdf.xacro file:

<?xml version="1.0"?>
<robot name="origins">
     <link name="$(arg tf_prefix_camera1)_pose_frame"/>
     <link name="$(arg tf_prefix_camera2)_link"/>

     <joint name="$(arg tf_prefix_camera1)_to_$(arg tf_prefix_camera2)" type="fixed">
       <parent link="$(arg tf_prefix_camera1)_pose_frame"/>
       <child link="$(arg tf_prefix_camera2)_link"/>
       <origin xyz="0.009 0.021 0.027" rpy="0.000 -0.018 0.005"/>
     </joint>
</robot>

So, this file has parameters tf_prefix_camera1 and tf_prefix_camera2. And i want to include this file in another xacro file and set this parameters. how can i do it?

<xacro:include filename="$(find realsense2_camera)/urdf/mount_t265_d435.urdf.xacro tf_prefix_camera1:=t265 tf_prefix_camera2:=d435" />

like this?