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:
@@ -182,12 +182,12 @@ 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,
|
||||
};
|
||||
mangled.el = if (mangled.el > 90)
|
||||
@min(mangled.el, 180 - self.conf.elevation_mask)
|
||||
@min(mangled.el, 180 - self.conf.elevation_mask) - self.offsets.el
|
||||
else
|
||||
@max(mangled.el, self.conf.elevation_mask);
|
||||
@max(mangled.el, self.conf.elevation_mask) + self.offsets.el;
|
||||
|
||||
self.sendRotatorCommand(.{ .set_position = mangled });
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user