Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spawn_model logging issue #597

Closed
joao-alex-cunha opened this issue Jul 12, 2017 · 2 comments
Closed

spawn_model logging issue #597

joao-alex-cunha opened this issue Jul 12, 2017 · 2 comments
Labels

Comments

@joao-alex-cunha
Copy link

I was trying to spawn a model in gazebo at runtime and I misread the proper usage message from spawn_model script. Not surprisingly the model wasn't spawning but I could understand why since the logging messages weren't appearing. Instead you get:

SpawnModel script started
No handlers could be found for logger "rosout"

and then a silent exit. On further inspection I found out that the messages weren't appearing since rospy.init_node('spawn_model') is invoked after the parsing of the user inputs, so these messages get dropped.

A solution would be to change all messages in the parsing phase to python prints or another logging framework, or to actually invoke rospy.init_node('spawn_model') before parsing the CLI inputs.

To reproduce this issue in a MWE open a terminal and start gazebo:

roslaunch gazebo_ros empty_world.launch

and in another terminal write:

rosrun gazebo_ros spawn_model -sdf -name cricket_ball -database cricket_ball

(the -name option doesn't exist, to make it work replace with -model). You might need to have the cricket_ball model in your local gazebo models folder.

I'm using ROS kinetic and Ubuntu 16.04

@pradhannihar
Copy link

pradhannihar commented Dec 28, 2017

i got the same issue but the exact way to spwan a model is

rosrun gazebo spawn_model -file `pwd`/object.urdf -urdf -z 1 -model my_object

In my command the -urdf was missing

This was referenced May 25, 2018
@kev-the-dev
Copy link
Collaborator

Fixed in #730

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants