diff --git a/Moving_Head_Test/pan_tilt_advanced_control.py b/Moving_Head_Test/pan_tilt_advanced_control.py index 7fb7ad5..29ec44c 100755 --- a/Moving_Head_Test/pan_tilt_advanced_control.py +++ b/Moving_Head_Test/pan_tilt_advanced_control.py @@ -422,16 +422,7 @@ class LowPassFilter: def calculate_pan(x_m: float, z_m: float, ceiling_mode: bool = False) -> int: - """Berechnet den Pan-DMX-Wert (0-255) basierend auf 3D-Koordinaten. - - Args: - x_m: X-Position in Metern (+X = rechts). - z_m: Z-Position (Tiefe) in Metern (+Z = vorne). - ceiling_mode: True bei hängender Deckenmontage. - - Returns: - Pan-DMX-Wert (0-255). - """ + """Berechnet den Pan-DMX-Wert (0-255) basierend auf 3D-Koordinaten.""" dx = x_m - OFFSET_X dz = max(0.20, z_m - OFFSET_Z) @@ -439,7 +430,7 @@ def calculate_pan(x_m: float, z_m: float, ceiling_mode: bool = False) -> int: pan_deg = math.degrees(pan_rad) pan_dmx = 127.5 + (pan_deg / (PAN_RANGE_DEG / 2.0)) * 127.5 - if ceiling_mode: + if not ceiling_mode: pan_dmx = 255.0 - pan_dmx return round(max(0.0, min(255.0, pan_dmx)))