URDF Parsing Issue with .xacro file
Hello,
I am having issues with spawning a robot in Gazebo by using a launch file. I am running ROS Noetic on Ubuntu 20.04 with Gazebo 11. The underlying issue is that the node uses a .xacro
file as robot_description
. The snippet of the code can be seem here:
<arg name="urdf" default="$(find cora_description)/urdf/cora.xacro"/>
<param name="$(arg namespace)/robot_description"
command="$(find xacro)/xacro --inorder '$(arg urdf)'
locked:=$(arg robot_locked)
namespace:=$(arg namespace) "/>
<!-- Spawn model in Gazebo -->
<node name="spawn_model" pkg="gazebo_ros" type="spawn_model"
args="-x $(arg x) -y $(arg y) -z $(arg z)
-R $(arg R) -P $(arg P) -Y $(arg Y)
-urdf -param $(arg namespace)/robot_description -model cora"/>
The error I get is the following:
Error [parser_urdf.cc:3183] Unable to call parseURDF on robot model
Error [parser.cc:488] parse as old deprecated model failed.
The part where I am unclear is that even though the URDF checker is running on the .xacro
file that is used in the .launch
file, this .xacro
file includes a .urdf.xacro
file (from urdf/cora.xacro):
<!-- Robot mesh -->
<xacro:include filename="$(find cora_description)/urdf/cora.urdf.xacro" />
I figured that because a URDF file is being included in the .xacro
file, there wouldn't be an issue with the urdf parser.
I additionally ran the check_urdf
command on both the urdf.xacro
file mentioned above and the xacro
file. The urdf.xacro
file didn't return any errors while for the xacro
file I had the following error:
Error: No link elements found in urdf file
at line 206 in /build/urdfdom-VnCcob/urdfdom-1.0.4+ds/urdf_parser/src/model.cpp
ERROR: Model Parsing the xml failed
Any help in describing what I may be missing will be helpful as this is code pulled from an open-source repo (https://github.com/osrf/vorc/) that has been widely used in other applications. I'm thinking that I may have a missing dependency or something along those lines.
Full roslaunch
error output:
SUMMARY
========
PARAMETERS
* /cora/robot_description: <?xml version="1....
* /gazebo/enable_ros_network: True
* /rosdistro: noetic
* /rosversion: 1.15.11
* /use_sim_time: True
NODES
/
gazebo (gazebo_ros/gzserver)
gazebo_gui (gazebo_ros/gzclient)
spawn_model (gazebo_ros/spawn_model)
auto-starting new master
process[master]: started with pid [20456]
ROS_MASTER_URI=http://localhost:11311
setting /run_id to 482c6b3a-1a29-11ec-bf61-81b15ac30dd6
process[rosout-1]: started with pid [20466]
started core service [/rosout]
process[gazebo-2]: started with pid [20472]
process[gazebo_gui-3]: started with pid [20478]
process[spawn_model-4]: started with pid [20483]
[ INFO] [1632152516.158574834]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1632152516.159897404]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1632152516.228341960]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1632152516.229919915]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
[ INFO] [1632152517.330225530]: waitForService: Service [/gazebo/set_physics_properties] is now available.
Error [parser_urdf.cc:3183] Unable to call parseURDF on robot model
Error [parser.cc:488] parse as old deprecated model file failed.
[ERROR] [1632152527.439477, 10.006000]: Spawn service ...
the XML entities may have been used to avoid problems with the XML parser. I've never had to use that though.
Because of the "no links in urdf file" it's likely you're not using the correct top-level
.xacro
file.In any case: I would suggest to post the complete output after you
roslaunch
to make sure you're not missing any errors/warnings.then I'm left wondering why you don't link to that repository. Right now we can only guess what you are using / seeing.
Edit: was osrf/vorc#42 also posted by you?
Yes, I posted that issue on the osrf/vorc repo
Also edited the post with the full output from
roslaunch
as well!Were you able to solve this issue. I am facing similar issue while trying to spawn a custom robot.