Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copter: Handle DO_MOUNT_CONTROL yaw angle as body frame #27071

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nexton-winjeel
Copy link
Contributor

The demanded yaw angles in the MOUNT_CONTROL and DO_MOUNT_CONTROL commands are in body frame (and are handled this way in AP_Mount). This fixes the Copter handlers where they were being treated as earth frame.

It also rejects these messages if an invalid mode is provided, as the yaw control is only applicable when the mode is MAV_MOUNT_MODE_MAVLINK_TARGETING.

FYI: @rmackay9

And only accept if the mode is MAV_MOUNT_MODE_MAVLINK_TARGETING. This matches the handlers in AP_Mount.
@@ -1219,6 +1219,7 @@ MAV_MISSION_RESULT AP_Mission::mavlink_int_to_mission_cmd(const mavlink_mission_
break;

case MAV_CMD_DO_MOUNT_CONTROL: // MAV ID: 205
// TODO: this is only valid if packet.z == MAV_MOUNT_MODE_MAVLINK_TARGETING
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be returning MAV_MISSION_INVALID_PARAM7 if the mode (packet.z) is not set to MAV_MOUNT_MODE_MAVLINK_TARGETING?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant