No link elements found in urdf file
Hello everyone,
I'm struggling a lot with launching my urdf file. I have been working on melodic with that urdf files perfectly but since I moved to work with noetic I can't run it. I have been searching on google and here but nothing helps me. I hope that someone here could help me with that issue.
I tried to put xacro:macro
in every place but it didn't solved.
In my last attempt, I kept just one link in my file and it didn't solve the problem.
Just when I use urdf without ant macro I could run it well.
so here are my 3 files:
launch file:
<?xml version="1.0"?>
<launch>
<!-- Load the URDF/Xacro model of your robot -->
<arg name="urdf_file" default="$(find xacro)/xacro '$(find robot_model)/urdf/robot.urdf.xacro'" />
<param name="robot_description" command="$(arg urdf_file)" />
<!--Publish the robot state -->
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher">
<param name="publish_frequency" value="20.0"/>
</node>
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
<param name="rate" value="20.0"/>
</node>
</launch>
robot.urdf.xacro:
<?xml version="1.0"?>
<robot name="box_robot" xmlns:xacro="http://ros.org/wiki/xacro">
<!-- Include all component files -->
<include filename="$(find robot_model)/urdf/materials.urdf.xacro" />
<include filename="$(find robot_model)/urdf/base.urdf.xacro" />
<!-- Add the drive wheels -->
<wheel parent="base" suffix="fr" reflects="1" reflectd="1" color="Black" type="fixed"/>
<wheel parent="base" suffix="fl" reflects="-1" reflectd="1" color="Black" type="fixed"/>
<rear_wheel parent="base" suffix="br" reflects="1" reflectd="-1" color="Black" type="fixed"/>
<rear_wheel parent="base" suffix="bl" reflects="-1" reflectd="-1" color="Black" type="fixed"/>
<!-- Add the base and wheels -->
<base name="base" color="Green"/>
</robot>
base.urdf.xacro:
<?xml version="1.0"?>
<robot name="robot" xmlns:xacro="http://ros.org/wiki/xacro">
<!-- Define a number of dimensions using properties -->
<property name="base_size_x" value="1.09" />
<property name="base_size_y" value="1.8" />
<property name="base_size_z" value="1.0" />
<property name="wheel_length" value="0.8" />
<property name="wheel_radius" value="0.5" />
<property name="wheel_offset_x" value="1.5" />
<property name="wheel_offset_y" value="0.8" />
<property name="wheel_offset_z" value="0.49" />
<property name="rear_wheel_offset_x" value="0.5" />
<property name="rear_wheel_offset_y" value="0.75" />
<property name="rear_wheel_offset_z" value="0.65" />
<property name="PI" value="3.1415" />
<!-- define a front wheel -->
<macro name="wheel" params="suffix parent reflects reflectd color type">
<joint name="${parent}_${suffix}_wheel_joint" type="${type}">
<axis xyz="0 0 1" />
<limit effort="100" velocity="100"/>
<safety_controller k_velocity="10" />
<origin xyz="${reflectd*wheel_offset_x} ${reflects*(wheel_offset_y)} ${wheel_offset_z}" rpy="0 0 0" />
<parent link="${parent}_link"/>
<child link="${parent}_${suffix}_wheel_link"/>
</joint>
<link name="${parent}_${suffix ...
I struggled a lot with this before. Not sure the changes were done between versions so what I opted to do with smaller
urdf
is to get rid ofmacro
all together. Make sure whencheck_urdf
tool passes then add them back one at the time.By getting rid of the
macro
what I mean is add each component manuallyBut one thing I’ll try before doing all that. Sorry I just noticed to change to
xacro:property
Also please this discussion: https://github.com/ros/xacro/issues/270