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

Slow-loading sensor plugin causes failure to load model plugins #3125

Closed
scpeters opened this issue Oct 22, 2021 · 1 comment
Closed

Slow-loading sensor plugin causes failure to load model plugins #3125

scpeters opened this issue Oct 22, 2021 · 1 comment

Comments

@scpeters
Copy link
Member

Since #3121 was recently merged, I have noticed a problem with some models that are slow to load. Specifically, if a model is spawned that contains a sensor plugin that is slow to load, it is possible that model plugins will fail to load, with the following error message:

[Err] [Model.cc:1061] Sensors failed to initialize when loading model[...] via the factory mechanism. Plugins for the model will not be loaded.

I believe this is caused by this logic in Model::LoadPlugins that skips loading of model plugins if the sensors take longer than 5 seconds to initialize, which includes the time required to load sensor plugins.

I have created a world file along with two test plugins to reproduce the failure in scpeters@8a2a4cc. The world has a WorldSpawnModelPlugin that spawns a model that has a single box with a camera sensor using the SlowLoadingSensorPlugin and the InitialVelocityPlugin as a model plugin. The box should be given an initial velocity after loading, but the slow-loading sensor plugin causes the model plugin to not be loaded, so the box remains at its initial pose.

scpeters added a commit to scpeters/gazebo that referenced this issue Oct 22, 2021
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit that referenced this issue Oct 25, 2021
As noted in #3125, loading a model may timeout when
loading model plugins if the model contains sensor
plugins that are slow to load. Since this timeout seems more
likely to occur since #3121 was merged, the default timeout
is increased from 5 seconds to 30 seconds, and an SDFormat
world parameter <ignition:model_plugin_loading_timeout> is
added to make the timeout configurable.

A regression test using a test world and two test plugins is
added to demonstrate the problem and confirm the fix.

* Fix typos in World.hh doc-strings
* Add IGN_PROFILE to World::ProcessFactoryMsgs
* Disable shadow caster test on macOS

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters
Copy link
Member Author

Closed by #3126

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

No branches or pull requests

1 participant