Skip to content

Commit

Permalink
action: fix set actuator index (#2275)
Browse files Browse the repository at this point in the history
This needs to be floored, not rounded, otherwise actuators above 3 won't
work for PX4.

Signed-off-by: Julian Oes <[email protected]>
  • Loading branch information
julianoes authored Apr 7, 2024
1 parent 6113b03 commit 324b645
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mavsdk/plugins/action/action_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ void ActionImpl::set_actuator_async(
command.params.maybe_param6 = value;
break;
}
command.params.maybe_param7 = static_cast<float>(zero_based_index) / 6.0f;
command.params.maybe_param7 = static_cast<float>(zero_based_index / 6);
} else {
if (callback) {
_system_impl->call_user_callback([temp_callback = callback]() {
Expand Down

0 comments on commit 324b645

Please sign in to comment.