Need help with find error in this urdf
Hi, I am learning the tutorial about urdf. I am at the exercise 8 now. The error I have when run the launch file is:
[ERROR] [1478674779.727709696]: length [${bodylen}] is not a valid float
[ERROR] [1478674779.727814955]: Could not parse visual element for Link [base_link]
[ERROR] [1478674779.727917245]: radius [${width}] is not a valid float: bad lexical cast: source type value could not be interpreted as target
[ERROR] [1478674779.727969693]: Could not parse visual element for Link [head]
.....
I will include here to the code from start to base_link. Please help me point out the issue. I cannot find out what is wrong.
<?xml version="1.0"?>
<robot name="macroed" xmlns:xacro="http://ros.org/wiki/xacro">
<!-- Convert to xacro-->
<robot xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
xmlns:xacro="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface" name="macroed">
...
Edit 1: I found the problem. I missed the 4 rows below the link but I got a new error and I don't understand what it is:
...
process[rviz-4]: started with pid [7571]
[ERROR] [1478753950.661833770]: Error reading end tag.
[robot_state_publisher-3] process has died [pid 7563, exit code -11, cmd /opt/ros/indigo/lib/robot_state_publisher/state_publisher __name:=robot_state_publisher __log:=/home/ubuntu/.ros/log/6a4eafd8-a702-11e6-98d1-00044b581868/robot_state_publisher-3.log].
log file: /home/ubuntu/.ros/log/6a4eafd8-a702-11e6-98d1-00044b581868/robot_state_publisher-3*.log
Traceback (most recent call last):
File "/opt/ros/indigo/lib/joint_state_publisher/joint_state_publisher", line 343, in <module>
jsp = JointStatePublisher()
File "/opt/ros/indigo/lib/joint_state_publisher/joint_state_publisher", line 26, in __init__
robot = xml.dom.minidom.parseString(description).getElementsByTagName('robot')[0]
File "/usr/lib/python2.7/xml/dom/minidom.py", line 1928, in parseString
return expatbuilder.parseString(string)
File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 940, in parseString
return builder.parseString(string)
File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 223, in parseString
parser.Parse(string, True)
xml.parsers.expat.ExpatError: no element found: line 239, column 0
[joint_state_publisher-2] process has died [pid 7555, exit code 1, cmd /opt/ros/indigo/lib/joint_state_publisher/joint_state_publisher __name:=joint_state_publisher __log:=/home/ubuntu/.ros/log/6a4eafd8-a702-11e6-98d1-00044b581868/joint_state_publisher-2.log].
log file: /home/ubuntu/.ros/log/6a4eafd8-a702-11e6-98d1-00044b581868/joint_state_publisher-2*.log
[ERROR] [1478753953.368324386]: No link elements found in urdf file
Edit 2: Full urdf xacro.
<?xml version="1.0"?>
<robot name="macroed" xmlns:xacro="http://ros.org/wiki/xacro">
<robot xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
xmlns:xacro="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface" name="macroed">
<!-- Convert to xacro-->
<xacro:property name="width" value="0.2" />
<xacro:property name="leglen" value="0.6" />
<xacro:property name="polelen" value="0.2" />
<xacro:property name="bodylen" value="0.6" />
<xacro:property name="baselen" value="0.4" />
<xacro:property name="wheeldiam" value="0.07" />
<xacro:property name="pi" value="3.1415" />
<material name="blue">
<color rgba="0 0 0.8 ...
I'm not quite sure, but I don't think that this substitution stuff actualy works with floats without leading 0. Can you try with adding this?
I will try and let you know.
I found the issue. I missed the 4 lines after . But then I got the new error and I cannot understand what it is. I added Edit 1.
Perhaps it would help if you post the full urdf, the tutorial you are using and how you fixed the previous error. From the error you are getting now I would suspect some of the tags are not being closed properly.
I have just added the full Urdf file. This is come from tutorial ex8 Using Xacro to Clean Up a URDF File
The problem is the error didn't tell where it found the problem. With a long urdf file, I have no idea how to find the issue.
You can use
gzsdf
to help debug your urdf file see here Gazebo ROS urdf, "Verifying the Gazebo Model Works"You need gazebo installed, and then :
gzsdf print MODEL.urdf
(gazebo2) orgz sdf -p MODEL.urdf
(Gazebo 3+)@Inounx: Does it check xacro macro? Or I have to convert to urdf first?