Skip to content

Conversation

@Hwurzburg
Copy link
Contributor

@Hwurzburg Hwurzburg commented Dec 13, 2025

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

@Hwurzburg
Copy link
Contributor Author

removed behavior as optional and now replaces current behavior as discussed in DevCall

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);
Copy link
Contributor

@rmackay9 rmackay9 Dec 19, 2025

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.

@rmackay9
Copy link
Contributor

I think after the wrap_PI() is added we can merge this, thanks!

} 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);
Copy link
Contributor

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gimbal WikiNeeded needs wiki update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants