From 6e4f984cea21f476fbe001cebee9e082ccad58a7 Mon Sep 17 00:00:00 2001 From: Mykhailo Ziatin Date: Sat, 27 Jan 2024 12:07:17 +0200 Subject: [PATCH] Add render engine option for `gz sim` command --- ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator b/ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator index d8ea0f3b95..ec619bbcda 100644 --- a/ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator +++ b/ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator @@ -64,6 +64,13 @@ elif [ "$PX4_SIMULATOR" = "gz" ] || [ "$(param show -q SIM_GZ_EN)" = "1" ]; then # "gz sim" from Garden on gz_command="gz" gz_sub_command="sim" + + # Specify render engine if `GZ_SIM_RENDER_ENGINE` is set + # (for example, if you want to use Ogre 1.x instead of Ogre 2.x): + if [ -n "${PX4_GZ_SIM_RENDER_ENGINE}" ]; then + echo "INFO [init] Setting Gazebo render engine to '${PX4_GZ_SIM_RENDER_ENGINE}'!" + gz_sub_command="${gz_sub_command} --render-engine ${PX4_GZ_SIM_RENDER_ENGINE}" + fi else echo "ERROR [init] Gazebo gz please install gz-garden" exit 1