main: treat elevation offset as offset from horizon

Rather than having somewhat confusing flipped logic when the rotator is
operating in the 180-90 degree elevation regime, this internally
performs sign flipping. This means that a 3 degree elevation offset
means "point an additional 3 degrees up from the horizon" regardless
of whether the rotator is operating in the 0-90 or 180-90 elevation
ranges.
This commit is contained in:
torque 2024-08-22 11:55:12 -07:00
parent b6caab906a
commit 86a5fa20a4
Signed by: torque
SSH Key Fingerprint: SHA256:nCrXefBNo6EbjNSQhv0nXmEg/VuNq3sMF5b8zETw3Tk

View File

@ -182,7 +182,7 @@ pub const RotInt = struct {
if (self.pollcount == 0) {
var mangled: AzEl = .{
.az = self.requested_posture.az + self.offsets.az,
.el = self.requested_posture.el + self.offsets.el,
.el = self.requested_posture.el + if (self.requested_posture.el > 90) -self.offsets.el else self.offsets.el,
};
mangled.el = if (mangled.el > 90)
@min(mangled.el, 180 - self.conf.elevation_mask)