-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
Mount: improve yaw lock reporting to GCS #26564
Conversation
Hello Randy, thank you for the effort. I think you missed my last commit on the original #26474 PR I opened about this: Ardupilot is always sending yaw in vehicle frame, and as per the documentation about this ( see mavlink/mavlink-devguide#531 ) It is preferable to use: GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME To indicate yaw frame, but if none of the above flags are set, the yaw frame will be interpreted from GIMBAL_DEVICE_FLAGS_YAW_LOCK. So this branch, as it is now, is not reporting correctly this. I tried to review and suggest the changes with github functionality but I don't think I have permission for it in AP ( would be good to have for such situations though! ). So please allow me to indicate here what I mean. In AP_Mount_Backend.cpp, in get_gimbal_device_flags(), at the end ( https://github.com/rmackay9/rmackay9-ardupilot/blob/3959c214e4ccf29802cb58489bee080090ddfd7b/libraries/AP_Mount/AP_Mount_Backend.cpp#L853 ), we would need to add the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME always, as Ardupilot is always using vehicle frame for gimbal yaw. It would end up something like this:
Otherwise, the receiver of this message will interpret angles based purely on GIMBAL_DEVICE_FLAGS_YAW_LOCK, and AP is not sending angles in earth frame when such flag is active. I tested that change ( just adding that flag as the code snippet above ) to your branch locally and it seems to work alright with the QGC PR you mentioned: mavlink/qgroundcontrol#11264. Thanks! |
This leads to smoother transitions between RC and GCS control
Co-authored-by: davidsastresas <[email protected]>
3959c21
to
f12ca0b
Compare
Thanks very much for the feedback. I've added your fix to the device flags and re-tested and it's working very well now, thanks! |
This is included in 4.5.2-beta1 |
This makes a few enhancements to our AP_Mount library to improve the GCS's ability to set and retrieve the current yaw-lock state. This is required for the QGC custom gimbal control screen (see mavlink/qgroundcontrol#11264)
To clear up terminology:
Detailed changes are:
This work was based on @Davidsastresas's earlier PR #26474
This has been lightly tested in SITL.