From 059da2fcf7e88fdae8e0373772032e47f383ff0e Mon Sep 17 00:00:00 2001 From: Dima Timofeev Date: Sun, 19 Apr 2026 12:33:03 -0700 Subject: [PATCH] fix(simulation): fix macOS gz SITL build Add the GStreamer pkg-config library directories so the Gazebo camera plugin links cleanly with Homebrew installs on macOS. Cast ESC actuator outputs to double before publishing rotor velocities to avoid clang's -Wdouble-promotion build failure. Signed-off-by: Dima Timofeev --- src/modules/simulation/gz_bridge/GZMixingInterfaceESC.cpp | 2 +- src/modules/simulation/gz_plugins/gstreamer/CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/simulation/gz_bridge/GZMixingInterfaceESC.cpp b/src/modules/simulation/gz_bridge/GZMixingInterfaceESC.cpp index a4e9e55686f..9b53315a0db 100644 --- a/src/modules/simulation/gz_bridge/GZMixingInterfaceESC.cpp +++ b/src/modules/simulation/gz_bridge/GZMixingInterfaceESC.cpp @@ -80,7 +80,7 @@ bool GZMixingInterfaceESC::updateOutputs(float outputs[MAX_ACTUATORS], unsigned rotor_velocity_message.mutable_velocity()->Resize(active_output_count, 0); for (unsigned i = 0; i < active_output_count; i++) { - rotor_velocity_message.set_velocity(i, outputs[i]); + rotor_velocity_message.set_velocity(i, static_cast(outputs[i])); } if (_actuators_pub.Valid()) { diff --git a/src/modules/simulation/gz_plugins/gstreamer/CMakeLists.txt b/src/modules/simulation/gz_plugins/gstreamer/CMakeLists.txt index 4397463b5c4..f8cec7c8dbb 100644 --- a/src/modules/simulation/gz_plugins/gstreamer/CMakeLists.txt +++ b/src/modules/simulation/gz_plugins/gstreamer/CMakeLists.txt @@ -45,6 +45,11 @@ else() GstCameraSystem.cpp ) + target_link_directories(${PROJECT_NAME} + PUBLIC ${GSTREAMER_LIBRARY_DIRS} + PUBLIC ${GSTREAMER_APP_LIBRARY_DIRS} + ) + target_link_libraries(${PROJECT_NAME} PUBLIC px4_gz_msgs PUBLIC ${GZ_SENSORS_TARGET}