Skip to content

Commit

Permalink
AP_Mount: fix GIMBAL_MANAGER_SET_PITCHYAW not working correctly when …
Browse files Browse the repository at this point in the history
…using multiple gimbals
  • Loading branch information
khanasif786 authored and rmackay9 committed Aug 9, 2023
1 parent 47977b1 commit f26528e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/AP_Mount/AP_Mount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,15 +486,15 @@ void AP_Mount::handle_command_gimbal_manager_set_pitchyaw(const mavlink_message_
if (!isnan(packet.pitch) && !isnan(packet.yaw)) {
const float pitch_angle_deg = degrees(packet.pitch);
const float yaw_angle_deg = degrees(packet.yaw);
set_angle_target(instance, 0, pitch_angle_deg, yaw_angle_deg, flags & GIMBAL_MANAGER_FLAGS_YAW_LOCK);
backend->set_angle_target(0, pitch_angle_deg, yaw_angle_deg, flags & GIMBAL_MANAGER_FLAGS_YAW_LOCK);
return;
}

// pitch_rate and yaw_rate from packet are in rad/s
if (!isnan(packet.pitch_rate) && !isnan(packet.yaw_rate)) {
const float pitch_rate_degs = degrees(packet.pitch_rate);
const float yaw_rate_degs = degrees(packet.yaw_rate);
set_rate_target(instance, 0, pitch_rate_degs, yaw_rate_degs, flags & GIMBAL_MANAGER_FLAGS_YAW_LOCK);
backend->set_rate_target(0, pitch_rate_degs, yaw_rate_degs, flags & GIMBAL_MANAGER_FLAGS_YAW_LOCK);
return;
}
}
Expand Down

0 comments on commit f26528e

Please sign in to comment.