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

Unable to convert URDF to sdf to use in Gazebo, but works fine in Rviz

asked 2019-09-20 12:16:04 -0600

JJJ gravatar image

Hi all,

I am new to ROS and was trying to follow along the urdf tutorials on URDF to create my own robot (a cart that should be pushed) and using it in Gazebo. I managed to create cart_v0.urdf.xacro that is visualized by

roslaunch urdf_tutorial display.launch model:=`rospack find reemc_cart`/urdf/cart_v0.urdf.xacro

like this (not enough karma to upload files). Then I try to

roslaunch urdf_sim_tutorial gazebo.launch model:=`rospack find reemc_cart`/urdf/cart_v0.urdf.xacro

according to the next tutorial in order to spawn the model in Gazebo, producing this console output (this indicates that the spawn has been successful right?). However, the produced world is empty besides the ground_plane, supposedly created by Gazebo?

I already tried converting cart_v0.urdf.xacro to cart_v0.urdf by

xacro --inorder cart_v0.urdf.xacro > cart_v0.urdf`

to test it for sdf generating by Gazebo according to

gz sdf -p cart_v0.urdf

However, the generated sdf file just consists of a sdf version and model name:

<sdf version='1.6'>
  <model name='reemc_cart'/>
</sdf>

I suppose this is also the reason why the world is empty without Gazebo throwing warnings/errors, but have not been able to find anyone suffering from the same problem. Is the fact that Rviz is able to show my urdf file without warnings enough indication that the URDF file itself is not faulty? And if the URDF is not faulty, where should I start looking in order to use this URDF in Gazebo?

I'm running Ubuntu 16.04 with ROS Kinetic and an install according to the relevant REEM-C tutorial. I tried to adhere to the post guidelines, but if I forgot to attach relevant information, please indicate it and I'll try to add it.

Thanks in advance!

edit retag flag offensive close merge delete

Comments

I approved you as a user and your post. I believe you should be able to upload files now. Good job providing all the relevant information despite this.

kscottz gravatar image kscottz  ( 2019-09-20 13:09:35 -0600 )edit
1

@kscottz: attaching images requires a minimum of 10 points. Just letting a user through the moderation queue does not change their karma, so @JJJ cannot post images.

@JJJ: I've given you sufficient karma to attach the images directly to your post.

Could you please also try to avoid using external pastebin like sites for linking to console output and/or .xacro files? Please include them also verbatim into your post. External sites tend to go away/die/don't have the retention we'd like, leaving your post with dead links in the future, reducing it's value significantly.

If files are long, place them at the end of your question text.

gvdhoorn gravatar image gvdhoorn  ( 2019-09-21 05:25:33 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
4

answered 2019-09-23 05:56:48 -0600

aPonza gravatar image

Could it be that you wrote <inertia> instead of <inertial>? For reference, this is also happening here.

edit flag offensive delete link more

Comments

1

You are right, you can see this stated in the official documentation under the Required section.

And just to be clear, the inertia, mass and origin tags have to be contained in the tag inertial (urdf specification here).

Delb gravatar image Delb  ( 2019-09-23 07:26:18 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-09-20 12:16:04 -0600

Seen: 985 times

Last updated: Sep 23 '19