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

Please help, converting urdf.xacro to SDF

asked 2013-05-13 12:29:13 -0600

Gazer gravatar image

updated 2014-01-28 17:16:31 -0600

ngrennan gravatar image

Hello all.

I am having trouble to convert the urdf.xacro files to sdf format, which is used by the newest version of gazebo. Any help will be greatly appreciated.

Thank you All! @Norman_Hendrich @hsu, please help!!!!!

edit retag flag offensive close merge delete

Comments

If you can provide more information, like the error msg etc, it would be easy to help.

ChickenSoup gravatar image ChickenSoup  ( 2013-05-13 16:55:59 -0600 )edit

Ok. I am interested in opening up the file download from https://github.com/utexas-bwi/segbot/tree/master/segbot_description. I followed the gazebo 1.5 tutorial from gazebosim's website, it's very clear in opening up the sdf. I am now using gazebo 1.7, according the forum, .urdf.xacro file is no

Gazer gravatar image Gazer  ( 2013-05-14 06:43:32 -0600 )edit

longer supported. So I am thinking of converting the urdf.xacro file unto the sdf format. But I have no idea how to do that.

Gazer gravatar image Gazer  ( 2013-05-14 06:46:30 -0600 )edit
1

did you run "rosrun xacro xacro.py [your_file.urdf.xacro] > [name_for_new_urdf.urdf]" and then "gzsdf print [name_for_new_urdf.urdf] > [name_for_new_sdf.urdf]"? and what is the error msg you're getting?

ChickenSoup gravatar image ChickenSoup  ( 2013-05-14 18:30:04 -0600 )edit

very weird. There might be a problem with my rosrun xacro xacro.py, when I ran it, it did convert xacro > urdf succesfully, but when I open the urdf it converts, it shows <root xmlns:xacro="http://ros.org/wiki/xacro"> <!-- Included URDF Files --> </root>

That urdf file is empty

Gazer gravatar image Gazer  ( 2013-05-15 13:33:10 -0600 )edit

can you tell what exactly you typed?

ChickenSoup gravatar image ChickenSoup  ( 2013-05-15 18:06:02 -0600 )edit

sorry, thank you for all of your help so far. For some unknown reason, I tried the same command on friend's computer, it works flawlessly. But when I tried the same command : rosrun xacro xacro.py my.xacro.urdf > my.urdf

a file was created. But when I open my.urdf, that file was actually empty

Gazer gravatar image Gazer  ( 2013-05-16 07:27:17 -0600 )edit

I still haven't figure it out what went wrong, but I guess I would use friend's computer for now. PS: I was also following following the gazebo tutorial from ROS website, I was unable to "roslaunch gazebo_worlds empty_world.launch" and "rosrun gazebo gzsdf print" to convert a file. So I guess

Gazer gravatar image Gazer  ( 2013-05-16 07:30:38 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2013-10-17 08:22:48 -0600

@Gazer:

Apologies for the delayed response. You are trying to convert the wrong file. You need to run xacro on the top level file as shown below:

rosrun xacro xacro.py `rospack find segbot_description`/robots/segbot.urdf.xacro use_full_gazebo_model:=true
edit flag offensive delete link more

Comments

The following problems appeared: File "/opt/ros/groovy/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 260, in _arg raise ArgException(arg_name) roslaunch.substitution_args.ArgException: use_full_gazebo_model

Lili Meng gravatar image Lili Meng  ( 2013-10-17 08:47:49 -0600 )edit

@Lili Meng: Groovy xacro has a bug in it. Download the hydro source here: https://github.com/ros/xacro/tree/hydro-devel

piyushk gravatar image piyushk  ( 2013-10-21 11:30:49 -0600 )edit
Lili Meng gravatar image Lili Meng  ( 2013-10-30 14:08:58 -0600 )edit

https://github.com/ros/xacro/tree/hydro-devel

piyushk gravatar image piyushk  ( 2013-11-01 07:19:03 -0600 )edit

Try typing out the link, or paste it from above. the original link I posted has bad html tag attached in the link.

piyushk gravatar image piyushk  ( 2013-11-01 07:19:50 -0600 )edit

@piyushk: Thank you, I have downloaded the new xacro and rosmake it, and after that tried the rosrun xacro xacro.py `rospack find segbot_description`/robots/segbot.urdf.xacro use_full_gazebo_model:=true, but it still has many problems. Traceback (most recent call last): File "/opt/ros/groovy/stacks/xacro/xacro.py", line 35, in <module> xacro.main() File "/opt/ros/groovy/stacks/xacro/src/xacro.py", line 563, in main eval_self_contained(doc) File "/opt/ros/groovy/stacks/xacro/src/xacro.py", line 504, in eval_self_contained eval_all(doc.documentElement, macros, symbols) File "/opt/ros/groovy/stacks/xacro/src/xacro.py", line 457, in eval_all eval_all(body, macros, scoped) File "/opt/ros/groovy/stacks/xacro/src/xacro.py", line 457, in eval_all eval_all(body, macros, scoped) File "/opt/ros/groovy/stacks/xacro/src/xacro.py", line 488, in eval_all result = eval_text(at[1], symbols) File "/opt/ros/groovy/stacks/xacro/src/xacro.py", line ...(more)

Lili Meng gravatar image Lili Meng  ( 2013-11-30 10:19:17 -0600 )edit

The new xacro is a catkin package, and does not use rosbuild. I suspect you are seeing this error because it never built properly, and you are still using the system groovy version of xacro. See http://wiki.ros.org/catkin/Tutorials/using_rosbuild_with_catkin

piyushk gravatar image piyushk  ( 2013-11-30 13:13:15 -0600 )edit
0

answered 2013-10-17 07:37:12 -0600

Hi Gazer,

   I have the same problem with you. I typed:  rosrun xacro xacro.py segbot_base.urdf.xacro > segbot_base.urdf  in the terminal. It indeed generated an urdf file, but it's empty inside of this urdf file.
edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-05-13 12:29:13 -0600

Seen: 2,491 times

Last updated: Oct 17 '13