-
Notifications
You must be signed in to change notification settings - Fork 19.9k
AP_Mount:Enhance YAW_LOCK to capture heading for target in lock for RC targetting #31713
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
base: master
Are you sure you want to change the base?
Conversation
9c5a856 to
768f23a
Compare
768f23a to
8d11a22
Compare
|
removed behavior as optional and now replaces current behavior as discussed in DevCall |
8d11a22 to
ab25b59
Compare
ab25b59 to
dfcd0fb
Compare
dfcd0fb to
c5232a4
Compare
libraries/AP_Mount/AP_Mount_Siyi.cpp
Outdated
| break; | ||
| case MountTargetType::RATE: | ||
| send_target_rates(mnt_target.rate_rads.pitch, mnt_target.rate_rads.yaw, mnt_target.rate_rads.yaw_is_ef); | ||
| update_angle_target_from_rate(mnt_target.rate_rads, mnt_target.angle_rad); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the angle targets will not be completely accurate because the gimbal does not perfectly obey our rate requests. I think this PR is still an improvement though so I'm not going to hold it up over this.
An alternative would be to use the angles reported by the gimbal but I'm not sure it's worth it.
|
I think after the wrap_PI() is added we can merge this, thanks! |
c5232a4 to
43eab30
Compare
| } else { | ||
| // yaw target in body frame so apply body frame limits | ||
| mnt_target.angle_rad.yaw = radians(((yaw_in + 1.0f) * 0.5f * (_params.yaw_angle_max - _params.yaw_angle_min) + _params.yaw_angle_min)); | ||
| wrap_PI(mnt_target.angle_rad.yaw += _yaw_lock_heading_rad); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work? I would have expected something like
mnt_target.angle_rad.yaw = wrap_PI(mnt_target.angle_rad.yaw + _yaw_lock_heading_rad)
43eab30 to
de075c8
Compare
de075c8 to
c756016
Compare
Adds a MOUNT_OPTION to change yaw_lock mount state which is used only in RC targeting and MAVLink from using North as the yaw target in RC targeting (MAVLINK provides the heading target) which captures heading on lock and uses it for the target instead of only pointing NORTH (which is useless). Now yaw will point in the same heading focussing on ROI as vehicle turns. Only affects yaw target.
Tested on CADDX