From bf8840d109508d398ac00e2a8b83a589d1f5d964 Mon Sep 17 00:00:00 2001 From: Jaeyoung Lim Date: Tue, 9 Jan 2024 10:27:37 +0100 Subject: [PATCH] Add topic remap plugin --- Tools/simulation/gz | 2 +- src/modules/simulation/gz_bridge/CMakeLists.txt | 8 ++++---- src/modules/simulation/gz_bridge/gz_env.sh.in | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Tools/simulation/gz b/Tools/simulation/gz index c78f7f0141..47e74c046b 160000 --- a/Tools/simulation/gz +++ b/Tools/simulation/gz @@ -1 +1 @@ -Subproject commit c78f7f01417168e8faab7a83ade2129c0d26b39d +Subproject commit 47e74c046b2fb10309743a0119d42a21e5e4fc65 diff --git a/src/modules/simulation/gz_bridge/CMakeLists.txt b/src/modules/simulation/gz_bridge/CMakeLists.txt index ba36f448d3..1e804c63f6 100644 --- a/src/modules/simulation/gz_bridge/CMakeLists.txt +++ b/src/modules/simulation/gz_bridge/CMakeLists.txt @@ -76,8 +76,8 @@ if(gz-transport_FOUND) px4_add_git_submodule(TARGET git_gz PATH "${PX4_SOURCE_DIR}/Tools/simulation/gz") include(ExternalProject) - ExternalProject_Add(gz - SOURCE_DIR ${PX4_SOURCE_DIR}/Tools/simulation/gz + ExternalProject_Add(px4_gz_plugins + SOURCE_DIR ${PX4_SOURCE_DIR}/Tools/simulation/gz/plugins CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} BINARY_DIR ${PX4_BINARY_DIR}/build_gz INSTALL_COMMAND "" @@ -121,14 +121,14 @@ if(gz-transport_FOUND) COMMAND ${CMAKE_COMMAND} -E env PX4_SIM_MODEL=gz_${model_only} $ WORKING_DIRECTORY ${SITL_WORKING_DIR} USES_TERMINAL - DEPENDS px4 + DEPENDS px4 px4_gz_plugins ) else() add_custom_target(gz_${model_only}_${world_name} COMMAND ${CMAKE_COMMAND} -E env PX4_SIM_MODEL=gz_${model_only} PX4_GZ_WORLD=${world_name} $ WORKING_DIRECTORY ${SITL_WORKING_DIR} USES_TERMINAL - DEPENDS px4 + DEPENDS px4 px4_gz_plugins ) endif() endforeach() diff --git a/src/modules/simulation/gz_bridge/gz_env.sh.in b/src/modules/simulation/gz_bridge/gz_env.sh.in index 810bc88948..8f4073e724 100644 --- a/src/modules/simulation/gz_bridge/gz_env.sh.in +++ b/src/modules/simulation/gz_bridge/gz_env.sh.in @@ -2,5 +2,7 @@ export PX4_GZ_MODELS=@PX4_SOURCE_DIR@/Tools/simulation/gz/models export PX4_GZ_WORLDS=@PX4_SOURCE_DIR@/Tools/simulation/gz/worlds +export PX4_GZ_PLUGINS=@PX4_SOURCE_DIR@/build/px4_sitl_default/build_gz export GZ_SIM_RESOURCE_PATH=$GZ_SIM_RESOURCE_PATH:$PX4_GZ_MODELS:$PX4_GZ_WORLDS +export GZ_SIM_SYSTEM_PLUGIN_PATH=$GZ_SIM_SYSTEM_PLUGIN_PATH:$PX4_GZ_PLUGINS