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

Cannot spawn a model in Gazebo

asked 2016-10-27 13:51:33 -0600

nsujumnong gravatar image

I've been trying to spawn a robot model in Gazebo after successfully converted from .xacro to .urdf. But when I tried to spawn the robot with terminal command, it gave me this error

nuttaworn@nuttaworn-Lenovo-Z50-70:~/valkyrie_ws/src/val_description/model/robots$ rosrun gazebo_ros spawn_model -file 'rospack find val_description'/model/robots/valkyrie_sim.urdf -urdf -z 1 -model valkyrie
spawn_model script started
[INFO] [WallTime: 1477593321.260120] [0.000000] Loading model xml from file
Error: file does not exist rospack find val_description/model/robots/valkyrie_sim.urdf

I checked the path to the urdf file and it's the exact path. I tried finding the package with rospack and it located the package without any problem. Can somebody point out what I missed? Thank you.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-10-27 14:58:50 -0600

gvdhoorn gravatar image

In order for your shell to run a command and use it's output as part of the command for the shell, you need to use backticks (`), not regular quotes ('). So your command line should probably be:

rosrun gazebo_ros spawn_model -file `rospack find val_description`/model/robots/valkyrie_sim.urdf -urdf -z 1 -model valkyrie
edit flag offensive delete link more


ahh.... that makes more sense. it works now. thank you so much

nsujumnong gravatar image nsujumnong  ( 2016-10-27 16:07:15 -0600 )edit

Question Tools

1 follower


Asked: 2016-10-27 13:51:33 -0600

Seen: 865 times

Last updated: Oct 27 '16