Gazebo | Ignition | Community
Ask Your Question

When the event worldCreated is triggered?

asked 2019-01-29 05:19:07 -0500

rasecg3 gravatar image

It sounds like a self answering question, but what I really would like to understand is _when_ a World is created, because currently my callback connected to this event is never called.

Bit of context:

I'm runninging a ModelPlugin. The model has a camera which is inside the meshes, so the model visual itself blocks the camera view. I already managed to set the visibility so the camera do not see the object. However, I'm only able to do it from the callback that is called when the event worldUpdateBegin is triggered.

I though I could use worldCreated or createdEntity, but they are never called.

The visuals are not "ready" neither on my Init() or Load() methods. So I would like to understand better the Event signals so I can choose one where:

1) Visual Entities are available for manipulation 2) It is not called periodically.

I'd appreciate if someone could give me a hint.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-01-29 10:42:47 -0500

chapulina gravatar image

The worldCreated event is triggered before ModelPlugins are loaded, so I wouldn't expect such plugins to ever hear the event. That is meant to be used by SystemPlugins.

If you're dealing with Visuals, I'd suggest you use a VisualPlugin instead of a ModelPlugin. That plugin's Load method should be called when the visual is ready.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-01-29 05:19:07 -0500

Seen: 334 times

Last updated: Jan 29 '19