how to include an existing urdf file into anothe urdf file with xacro
Hi, I have written a short urdf file to describe my tool and a launch file to open it in rviz. So far everything displays correctly and there are no errors.
Now, I want to include another urdf file and position it with respect to my part with a joint. The other urdf file is using xacro, which I find really confusing to use. When I try to launch it, I get an error that "no link elements found' and in rviz it says no tf data and there are no fixed frames available. I tried to put assembly_tool] but it can't find this frame. The first is my urdf file and the one below is the relevant excerpt of the existing urdf that I want to include and the third the launch file I use. Could anyone tell me where my problem lies? Thanks in advance!
<?xml version="1.0"?>
<robot name="grinding_tool" xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:include filename="$(find compliant_tool_description)/urdf_src/compliant_tool2.urdf.xacro" />
<!-- Useful definitions -->
<xacro:macro name="grinding_tool" params="ee_link_name">
<xacro:property name="ee_link_name" value="ee_link"/>
<link name="ee_link"/>
<link name="assembly_tool">
<visual>
<geometry>
<mesh filename="package://grinding_tool/meshes/assembly.stl" scale="0.001 0.001 0.001"/>
</geometry>
<material name="gray">
<color rgba="0.8 0.8 0.8 1.0"/>
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<box size="0.42 0.17 0.15"/>
</geometry>
</collision>
<inertial>
<origin xyz="0 0 0" rpy="0 0 0"/>
<mass value="3.3"/>
<inertia ixx="0.0019"
ixy="0" iyy="0.072"
ixz="0" iyz="0" izz="0.074"/>
</inertial>
</link>
</xacro:macro>
<gazebo reference="tool">
<mu1 value="200.0"/>
<mu2 value="100.0"/>
<kp value="10000000.0" />
<kd value="1.0" />
<material>Gazebo/Grey</material>
</gazebo>
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>/</robotNamespace>
</plugin>
</gazebo>
</robot>
The only thing I adapted was including a joint: comp_grinding_joint to connect my urdf to the compliant tool urdf.
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:include filename="$(find compliant_tool_description)/urdf_src/include/compliant_tool_parameters.urdf.xacro"
ns="cmptool"/>
<!-- Useful definitions -->
<xacro:property name="meshes_path"
value="package://compliant_tool_description/meshes"/>
<xacro:property name="meshes_scale"
value="0.001 0.001 0.001"/>
<xacro:macro name="compliant_tool" params="ee_link_name">
<joint name="comp_grinding_JOINT" type="fixed">
<origin xyz="0 0 0.0019" rpy="0 0 0"/>
<parent link="assembly_tool"/>
...
<link name="${ee_link_name}_sliderplate">
<visual>
<origin xyz="0 0 0.057" rpy="${cmptool.PI} 0 0"/>
<geometry>
<mesh filename="${meshes_path}/sliderplate_with_joint.stl" scale="${meshes_scale}"/>
</geometry>
<material name="gray">
<color rgba="${105/255} ${105/255} ${105/255} 1.0"/>
</material>
</visual>
<collision>
<origin xyz="0 0 0 ...
How is this different than this question? https://answers.ros.org/question/3544...