0
$\begingroup$

Gazebo Answers logo

I want to use gazebo load my robot model (a urdf file),but do not want to install ros. Is there any kind of tool to make my urdf file be load by gazebo? Is there any way to do this ? Is there any document example or tutorials about this? Please help. Thanks.


Originally posted by xianxjm on Gazebo Answers with karma: 15 on 2017-11-30

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

You can use the command line. Here a MWE:

# Download the URDF and convert it to SDF
$ wget https://gist.githubusercontent.com/fsuarez6/f8503449ce747668e30a742289c26e58/raw/132506b4fa03879d4309ff9014c16d9df6e5f740/rrbot.xacro.urdf
$ gz sdf --print rrbot.xacro.urdf > rrbot.sdf
# Start gazebo
$ gazebo
# Open another terminal, and spawn the model
$ gz model --spawn-file=rrbot.sdf --model-name=rrbot

Tested on Ubuntu 16.04 (Xenial):

$ gazebo --version
Gazebo multi-robot simulator, version 7.0.0
Copyright (C) 2012-2016 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

Update

Thanks to @nkoenig comment, you can spawn directly URDF models. Here a MWE:

# Download the URDF
$ wget https://gist.githubusercontent.com/fsuarez6/f8503449ce747668e30a742289c26e58/raw/132506b4fa03879d4309ff9014c16d9df6e5f740/rrbot.xacro.urdf
# Start gazebo
$ gazebo
# Open another terminal, and spawn the model
$ gz model --spawn-file=rrbot.xacro.urdf --model-name=rrbot

Originally posted by Francisco with karma: 143 on 2017-11-30

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by nkoenig on 2017-12-01:
Gazebo uses libsdformat, which can read both SDF and URDF files.

Comment by xianxjm on 2017-12-03:
it works ,thanks!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.