Set the movers' zeros and pan directions, swap M1/M2's patch, and model tilt in the simulator.
The front right mover is on DMX 1 and the front left on 45, so M1 and M2 swap addresses in the stage map and test.qxw. Measured on the rig, pan 0 faces forward on the front pair and into the middle on the back pair, back at 85. M1 and M4 turn anticlockwise, so movers get a pan_reverse flag. Tilt 127 now points straight down: the simulator draws a spot under the head, and past 127 the beam flips behind the pan heading. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2b0f9e2f9b
commit
fc8abf9c99
9 files changed
+124
-26
No files matched your search
+12
-2
@@ -6,6 +6,7 @@ such as Dimmer, Red, Pan, and Zoom select the slots.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import math
|
||||
import re
|
||||
|
||||
from simulator.stage import Fixture, Stage
|
||||
@@ -13,6 +14,10 @@ from simulator.stage import Fixture, Stage
|
||||
_PIXEL = re.compile(r"^(red|green|blue|white) (\d+)$", re.IGNORECASE)
|
||||
|
||||
PAN_DEGREES = 540.0
|
||||
# Tilt 127 is straight down. 0 leans along the pan heading, 255 away from it.
|
||||
TILT_DEGREES = 270.0
|
||||
# Plan reach of a beam at or above horizontal.
|
||||
BEAM_MAX_M = 4.7
|
||||
ZOOM_MIN = 5.0
|
||||
ZOOM_MAX = 45.0
|
||||
|
||||
@@ -378,8 +383,10 @@ def _decode_mover_named(channels: list[int], names: list[str]) -> dict:
|
||||
pan_speed = _value(channels, names, "Pan/Tilt Speed")
|
||||
pan_deg = (pan - 32768) / 65536.0 * PAN_DEGREES
|
||||
zoom_deg = ZOOM_MIN + (zoom / 255.0) * (ZOOM_MAX - ZOOM_MIN)
|
||||
# Long enough to read on the plan at tilt zero. Tilt stretches the throw.
|
||||
beam_m = 2.2 + (tilt / 65535.0) * 2.5
|
||||
tilt_deg = (tilt - 32768) / 65536.0 * TILT_DEGREES
|
||||
# Reach along the pan heading on the plan. Negative points behind it.
|
||||
lean = max(-90.0, min(90.0, -tilt_deg))
|
||||
beam_m = BEAM_MAX_M * math.sin(math.radians(lean))
|
||||
return {
|
||||
"r": red,
|
||||
"g": green,
|
||||
@@ -393,6 +400,7 @@ def _decode_mover_named(channels: list[int], names: list[str]) -> dict:
|
||||
"speed_hz": speed,
|
||||
"dynamic": dynamic_name,
|
||||
"pan_deg": round(pan_deg, 2),
|
||||
"tilt_deg": round(tilt_deg, 2),
|
||||
"zoom_deg": round(zoom_deg, 2),
|
||||
"beam_m": round(beam_m, 3),
|
||||
"pixels": tinted,
|
||||
@@ -422,6 +430,8 @@ def view_fixture(fixture: Fixture, universes: dict[int, bytes]) -> dict:
|
||||
viewed = decode_mover(channels)
|
||||
else:
|
||||
viewed = decode_can(channels)
|
||||
if fixture.pan_reverse and "pan_deg" in viewed:
|
||||
viewed["pan_deg"] = -viewed["pan_deg"]
|
||||
viewed["patched"] = True
|
||||
return viewed
|
||||
|
||||
|
||||
Reference in new issue
Block a user