main: respect the elevation mask after applying offsets
This prevents offsets from being able to point below the elevation mask. The way this is done should probably be reworked, but this whole thing is such a messy hack anyway that, like, whatever, man.
This commit is contained in:
parent
db55a5081d
commit
f74b4dead3
10
src/main.zig
10
src/main.zig
@ -185,9 +185,15 @@ pub const RotInt = struct {
|
||||
.el = self.requested_posture.el,
|
||||
};
|
||||
mangled.el = if (mangled.el > 90)
|
||||
@min(mangled.el, 180 - self.conf.elevation_mask) - self.offsets.el
|
||||
@min(
|
||||
@min(mangled.el, 180 - self.conf.elevation_mask) - self.offsets.el,
|
||||
180 - self.conf.elevation_mask,
|
||||
)
|
||||
else
|
||||
@max(mangled.el, self.conf.elevation_mask) + self.offsets.el;
|
||||
@max(
|
||||
@max(mangled.el, self.conf.elevation_mask) + self.offsets.el,
|
||||
self.conf.elevation_mask,
|
||||
);
|
||||
|
||||
self.sendRotatorCommand(.{ .set_position = mangled });
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user