Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

You can register to the add entity event, and do the initialization asynchronously.

event::ConnectionPtr add_entity_connection = event::Events::ConnectAddEntity(
    std::bind(&MyWorldPlugin::addEntityEventCallback, this, std::placeholders::_1));

void MyWorldPlugin::addEntityEventCallback(const std::string &name) {
    // Check entity name...
    // Trigger initialization...
}