From 324b64543d5ec1ad3d480b6d8a13d6cdc67ee68b Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Sun, 7 Apr 2024 15:20:26 +1200 Subject: [PATCH] action: fix set actuator index (#2275) This needs to be floored, not rounded, otherwise actuators above 3 won't work for PX4. Signed-off-by: Julian Oes --- src/mavsdk/plugins/action/action_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mavsdk/plugins/action/action_impl.cpp b/src/mavsdk/plugins/action/action_impl.cpp index bf0a14f90..d3ce90345 100644 --- a/src/mavsdk/plugins/action/action_impl.cpp +++ b/src/mavsdk/plugins/action/action_impl.cpp @@ -554,7 +554,7 @@ void ActionImpl::set_actuator_async( command.params.maybe_param6 = value; break; } - command.params.maybe_param7 = static_cast(zero_based_index) / 6.0f; + command.params.maybe_param7 = static_cast(zero_based_index / 6); } else { if (callback) { _system_impl->call_user_callback([temp_callback = callback]() {