mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 11:59:17 +08:00
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 <dimkat@gmail.com>
This commit is contained in:
committed by
Ramon Roche
parent
67cb65f237
commit
059da2fcf7
@@ -80,7 +80,7 @@ bool GZMixingInterfaceESC::updateOutputs(float outputs[MAX_ACTUATORS], unsigned
|
|||||||
rotor_velocity_message.mutable_velocity()->Resize(active_output_count, 0);
|
rotor_velocity_message.mutable_velocity()->Resize(active_output_count, 0);
|
||||||
|
|
||||||
for (unsigned i = 0; i < active_output_count; i++) {
|
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<double>(outputs[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_actuators_pub.Valid()) {
|
if (_actuators_pub.Valid()) {
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ else()
|
|||||||
GstCameraSystem.cpp
|
GstCameraSystem.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_link_directories(${PROJECT_NAME}
|
||||||
|
PUBLIC ${GSTREAMER_LIBRARY_DIRS}
|
||||||
|
PUBLIC ${GSTREAMER_APP_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME}
|
target_link_libraries(${PROJECT_NAME}
|
||||||
PUBLIC px4_gz_msgs
|
PUBLIC px4_gz_msgs
|
||||||
PUBLIC ${GZ_SENSORS_TARGET}
|
PUBLIC ${GZ_SENSORS_TARGET}
|
||||||
|
|||||||
Reference in New Issue
Block a user