Error: Joint is missing a parent and/or child -> No TF data
Hi all,
I'm trying to build a robotic arm, but I'm having troubles when I create the macro to simplify the code. I have the next error:
Failed to build tree: Joint [module_1_length_yaw_joint] is missing a parent and/or child link specification.
I have try to solve it modifying the code as many times I imagine it could works, but anyway it didn't work.
EDIT: This part is solve at this moment, but after this solution, there is no TF data received. Although the robot is correctly display in Gazebo the is only TF for the 2 firsts links.
-- LAUNCH FILE --
<?xml version="1.0"?>
<launch>
<!--arg name="robot_model" default="summit_xl_std.urdf.xacro"/-->
<arg name="robot_model" default="robot.xacro"/>
<arg name="x" default="2.0"/>
<arg name="y" default="0.0"/>
<arg name="z" default="0.0"/>
<!-- Load the URDF into ROS parameter server -->
<!--arg name="urdf_file" default="$(find xacro)/xacro '$(find summit_xl_description)/robots/$(arg robot_model)' inorder" /-->
<arg name="urdf_file" default="$(find xacro)/xacro '$(find arm_description)/urdf/$(arg robot_model)'" />
<param name="robot_description" command="$(arg urdf_file)" />
<!-- Gazebo -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find arm_gazebo)/worlds/crasar_complete.world"/>
</include>
<!-- Spawn a robot into Gazebo -->
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model"
args="-param robot_description
-urdf
-x '$(arg x)'
-y '$(arg y)'
-z '$(arg z)'
-model fotokite"/>
<!-- send fake joint values -->
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
<!--param name="use_gui" value="FALSE"/-->
</node>
<!-- convert joint states to TF transforms for rviz, etc -->
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
respawn="false" output="screen">
<remap from="/joint_states" to="/fotokite/joint_states" />
</node>
</launch>
-- /LAUNCH FILE
-- XACRO CALLER --
<?xml version="1.0"?>
<robot name="fotokite" xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:include filename="$(find arm_description)/urdf/fotokite.urdf.xacro" />
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>/fotokite</robotNamespace>
</plugin>
</gazebo>
<link name="world"/>
<!-- Fotokite -->
<fotokite_arm parent="world">
<origin xyz="0 0 0" rpy="0 0 0" />
</fotokite_arm>
</robot>
-- /XACRO CALLER --
Here is the code for the macro that is called to create the robotic arm:
-- CODE --
<?xml version="1.0"?>
<robot name="fotokite" xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:macro name="fotokite_arm" params="parent *origin">
<xacro:property name="PI" value="3.14159265359"/>
<!-- Joints Control in Gazebo -->
<!--gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"/>
</gazebo-->
<!-- Geometrical properties -->
<xacro:property name="link_side" value="0.04"/>
<xacro:property name="joint_radius" value="0.018"/>
<xacro:property name="joint_length" value="0.025"/>
<xacro:property name="length" value="0.04"/>
<xacro:property name="mass" value="1.0"/>
<!-- Materials -->
<material name="orange">
<color rgba="1.00 0.67 0.02 1.00"/>
</material>
<material name="gray">
<color rgba="0.80 0.80 0.80 1.00"/>
</material>
<!-- Generates a box visual/collision/inertial -->
<xacro:macro name="prism_vci" params="side length mass:=1 *origin">
<xacro:macro name="prism_geometry">
<xacro:insert_block name="origin"/>
<geometry>
<box size="${side} ${side} ${length}"/>
</geometry>
</xacro:macro>
<visual>
<xacro:prism_geometry/>
<material name="orange"/>
</visual>
<collision>
<xacro:prism_geometry/>
</collision>
<inertial>
<xacro:insert_block name="origin ...
If I comment the first if for the child
The error is different:
Have you tried converting your xacro file into urdf to directly see the values of the variables ? You would directly see all the children and parents like that (see #q10401).
Hi @Delb, I had the same error if I try to convert to URDF.