mirror of
https://github.com/EyeTrackVR/EyeTrackVR.git
synced 2025-11-04 14:39:42 +08:00
fix flip right axis, fix http add
This commit is contained in:
parent
5c0b1b45fd
commit
137f3004f7
@ -59,10 +59,8 @@ class Camera:
|
|||||||
if (
|
if (
|
||||||
self.config.capture_source != None and self.config.capture_source != ""
|
self.config.capture_source != None and self.config.capture_source != ""
|
||||||
):
|
):
|
||||||
# if len(self.current_capture_source) > 2 and "http" not in self.current_capture_source:
|
|
||||||
# self.current_capture_source = f"http://{self.current_capture_source}/"
|
if (self.config.capture_source[:3] == "COM"):
|
||||||
# print(self.current_capture_source)
|
|
||||||
if (self.current_capture_source[:3] == "COM"):
|
|
||||||
if (
|
if (
|
||||||
self.serial_connection is None
|
self.serial_connection is None
|
||||||
or self.camera_status == CameraState.DISCONNECTED
|
or self.camera_status == CameraState.DISCONNECTED
|
||||||
|
|||||||
@ -1,9 +1,16 @@
|
|||||||
import sys
|
import sys
|
||||||
from utils.misc_utils import PlaySound, SND_FILENAME, SND_ASYNC
|
from utils.misc_utils import PlaySound, SND_FILENAME, SND_ASYNC
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
from enum import IntEnum
|
||||||
|
|
||||||
|
class EyeId(IntEnum):
|
||||||
|
RIGHT = 0
|
||||||
|
LEFT = 1
|
||||||
|
BOTH = 2
|
||||||
|
SETTINGS = 3
|
||||||
|
|
||||||
def cal_osc(self, cx, cy):
|
def cal_osc(self, cx, cy):
|
||||||
if self.eye_id == "EyeId.RIGHT":
|
if self.eye_id == EyeId.RIGHT:
|
||||||
flipx = self.settings.gui_flip_x_axis_right
|
flipx = self.settings.gui_flip_x_axis_right
|
||||||
else:
|
else:
|
||||||
flipx = self.settings.gui_flip_x_axis_left
|
flipx = self.settings.gui_flip_x_axis_left
|
||||||
@ -61,7 +68,7 @@ def cal_osc(self, cx, cy):
|
|||||||
if yu > 0:
|
if yu > 0:
|
||||||
out_y = max(0.0, min(1.0, yu))
|
out_y = max(0.0, min(1.0, yu))
|
||||||
|
|
||||||
if flipx: #TODO Check for working function
|
if flipx:
|
||||||
if xr >= 0:
|
if xr >= 0:
|
||||||
out_x = -abs(max(0.0, min(1.0, xr)))
|
out_x = -abs(max(0.0, min(1.0, xr)))
|
||||||
if xl > 0:
|
if xl > 0:
|
||||||
@ -72,7 +79,7 @@ def cal_osc(self, cx, cy):
|
|||||||
if xl > 0:
|
if xl > 0:
|
||||||
out_x = -abs(max(0.0, min(1.0, xl)))
|
out_x = -abs(max(0.0, min(1.0, xl)))
|
||||||
except:
|
except:
|
||||||
print("[ERROR] Eye Calibration Invalid!")
|
print("\033[91m[ERROR] Eye Calibration Invalid!\033[0m")
|
||||||
out_x = 0.5
|
out_x = 0.5
|
||||||
out_y = 0.5
|
out_y = 0.5
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user