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

add srdf file to gazebo empty_world

asked 2017-08-22 12:41:43 -0600

maxgitt gravatar image

I would like to simply load a srdf file to Gazebo instead of an URDF file. I followed a simple Gazebo tutorial that instructs me on how to launch an URDF file using the following commands:

Terminal 1:

roslaunch gazebo_ros empty_world.launch

Terminal 2:

rosrun gazebo_ros spawn_model -file `rospack find robot_pkg`/urdf/MYROBOT.urdf -urdf -model MYROBOT

This spawns the robot in Gazebo but not without fidgeting completely (possibly due to self-collisions) and jumping 1000 ft in the air. So I am trying to load a SRDF file instead with the following commands:

Terminal 1:

roslaunch gazebo_ros empty_world.launch

Terminal 2:

rosrun gazebo_ros spawn_model -file `rospack find robot_config`/config/MYROBOT.srdf -sdf -model MYROBOT

When I hit enter on Terminal 2, the following occurs:

SpawnModel script started
[INFO] [1503422995.443726, 0.000000]: Loading model XML from file
[INFO] [1503422995.444003, 0.000000]: Waiting for service /gazebo/spawn_sdf_model
[INFO] [1503422995.444960, 0.000000]: Calling service /gazebo/spawn_sdf_model
[INFO] [1503423005.472383, 16.663000]: Spawn status: SpawnModel: Entity pushed to spawn queue, but spawn service timed out waiting for entity to appear in simulation under the name kr500

Then Terminal 1 reads

Error:   No link elements found in urdf file
     at line 180 in /build/urdfdom-UJ3kd6/urdfdom-0.4.1/urdf_parser/src/model.cpp
Error [parser_urdf.cc:3408] Unable to call parseURDF on robot model
Error [parser.cc:340] parse as old deprecated model file failed.

What doesn't make sense is why the tutorial tells me I should be able to simply load up a SRDF file. I looked over the parameters to run on the terminal and they appear correct. Only terminal 1 should be calling parseSDF not parseURDF. Maybe this is my problem. But I'm not instructed on what commands to run so any further knowledge on the command to load a SDF file would be helpful.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-08-22 13:40:16 -0600

gvdhoorn gravatar image

updated 2017-08-22 14:34:42 -0600

.srdf != .sdf.

srdf files are MoveIt Robot Semantic Description files. sdf is Gazebo's Simulation Description Format.

Those are not related and you cannot load an srdf file in Gazebo.

What doesn't make sense is why the tutorial tells me I should be able to simply load up a SRDF file

I don't believe it actually tells you that SRDF is supported.

This spawns the robot in Gazebo but not without fidgeting completely (possibly due to self-collisions) and jumping 1000 ft in the air.

One thing to check is that you have your robot linked to the world frame using a fixed joint.

edit flag offensive delete link more

Comments

Adding the world frame helped me take a step towards a more stable robot. But I'll be attempting to fix other joints that are misbehaving

maxgitt gravatar image maxgitt  ( 2017-08-22 15:35:25 -0600 )edit

Hi @maxgiit have you found the solution yet, i face the same problem as you :(

nknight gravatar image nknight  ( 2019-12-30 08:21:09 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-08-22 12:41:43 -0600

Seen: 1,923 times

Last updated: Aug 22 '17