SITL gz fixes and init cleanup (#20725)

- remove broken gz version handling and remove x500-legacy
 - fix all shellcheck warnings
 - prepare for Gazebo Garden compatibility (needs more work)
This commit is contained in:
Daniel Agar
2022-12-07 15:41:13 -05:00
committed by GitHub
parent f2c71a8874
commit 72cb4bee01
12 changed files with 61 additions and 150 deletions
@@ -31,21 +31,28 @@
#
############################################################################
# Find the Ignition_Transport library
find_package(ignition-transport
# Find the gz_Transport library
find_package(gz-transport
#REQUIRED COMPONENTS core
NAMES
ignition-transport8
ignition-transport10
ignition-transport11
gz-transport12
#QUIET
)
if(ignition-transport_FOUND)
if(gz-transport_FOUND)
add_compile_options(-frtti -fexceptions)
set(IGN_TRANSPORT_VER ${ignition-transport_VERSION_MAJOR})
set(GZ_TRANSPORT_VER ${gz-transport_VERSION_MAJOR})
if (GZ_TRANSPORT_VER GREATER_EQUAL 12)
set(GZ_TRANSPORT_LIB gz-transport${GZ_TRANSPORT_VER}::core)
else()
set(GZ_TRANSPORT_LIB ignition-transport${GZ_TRANSPORT_VER}::core)
endif()
px4_add_module(
MODULE modules__simulation__gz_bridge
@@ -58,7 +65,7 @@ if(ignition-transport_FOUND)
DEPENDS
mixer_module
px4_work_queue
ignition-transport${IGN_TRANSPORT_VER}::core
${GZ_TRANSPORT_LIB}
MODULE_CONFIG
module.yaml
)
@@ -4,3 +4,6 @@ export PX4_GZ_MODELS=@PX4_SOURCE_DIR@/Tools/simulation/gz/models
export PX4_GZ_WORLDS=@PX4_SOURCE_DIR@/Tools/simulation/gz/worlds
export IGN_GAZEBO_RESOURCE_PATH=$IGN_GAZEBO_RESOURCE_PATH:$PX4_GZ_MODELS:$PX4_GZ_WORLDS
# IGN -> GZ as of Garden
export GZ_SIM_RESOURCE_PATH=$GZ_SIM_RESOURCE_PATH:$PX4_GZ_MODELS:$PX4_GZ_WORLDS