Skip to content

[Bug] GZ Simulation bricked with worlds different from 'default', waiting endlessly #23612

@shadowcpy

Description

@shadowcpy

Describe the bug

When spawning any other world in Gazebo Ignition with make px4_sitl gz_standard_vtol_default2
with world 'default2' being an exact copy of 'default', with only the name change in the SDF File, the GZ Bridge does not exit its loop for waiting on Gazebo, endlessly cycling with:

ERROR [gz_bridge] Service call timed out. Check GZ_SIM_RESOURCE_PATH is set correctly.
WARN  [gz_bridge] Service call timed out as Gazebo has not been detected.

This is due to an oversight in commit ae16556, where the world name was not correctly substituted into the string for the message call

Diff to fix the issue:

diff --git a/src/modules/simulation/gz_bridge/GZBridge.cpp b/src/modules/simulation/gz_bridg
e/GZBridge.cpp
index 7b45600e57..29d19fe111 100644
--- a/src/modules/simulation/gz_bridge/GZBridge.cpp
+++ b/src/modules/simulation/gz_bridge/GZBridge.cpp
@@ -154,7 +154,7 @@ int GZBridge::init()
 				return PX4_ERROR;
 			}

-			std::string scene_info_service = "/world/default/scene/info";
+			std::string scene_info_service = "/world/" + _world_name + "/scene/
info";
 			bool scene_created = false;

 			while (scene_created == false) {

Thank you in advance

To Reproduce

No response

Expected behavior

No response

Screenshot / Media

No response

Flight Log

No response

Software Version

5656072

Flight controller

No response

Vehicle type

None

How are the different components wired up (including port information)

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions