ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

URDF Parsing Issue with .xacro file

asked 2021-09-17 11:50:04 -0500

bags gravatar image

updated 2021-09-20 10:56:12 -0500

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 &#x002D;&#x002D;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 ...
(more)
edit retag flag offensive close merge delete

Comments

2

command="$(find xacro)/xacro --inorder '$(arg urdf)'

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.

Any help in describing what I may be missing will be helpful as this is code pulled from an open-source repo that has been widely used in other applications

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?

gvdhoorn gravatar image gvdhoorn  ( 2021-09-18 02:23:23 -0500 )edit

Yes, I posted that issue on the osrf/vorc repo

bags gravatar image bags  ( 2021-09-20 10:43:48 -0500 )edit

Also edited the post with the full output from roslaunch as well!

bags gravatar image bags  ( 2021-09-20 10:47:36 -0500 )edit

Were you able to solve this issue. I am facing similar issue while trying to spawn a custom robot.

Chubba_07 gravatar image Chubba_07  ( 2023-03-06 05:59:20 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-09-17 12:39:02 -0500

Airuno2L gravatar image

The error that says:

Error [parser_urdf.cc:3183] Unable to call parseURDF on robot mode

Makes me think there is a typo somewhere. I would think it should say robot model not mode

edit flag offensive delete link more

Comments

You are correct, the returned error is robot model - I made an error while copying the error over. I fixed it on the post and edited it!

bags gravatar image bags  ( 2021-09-17 14:34:13 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-09-17 11:50:04 -0500

Seen: 3,758 times

Last updated: Sep 20 '21