Skip to content

BUG: Crash caused by stopping calibration #146

@m-RNA

Description

@m-RNA



PROBLEM DESCRIPTION

A bug occurs when connecting to the camera, then clicking “Stop Calibration” directly (without first clicking “Start Calibration”). This causes the eyetrack_setting.json file’s calib_axes and calib_evecs to be zeroed, which results in the software crashing with a ValueError, and prevents normal operation. After this, any use of calibration (e.g., matrix operations in calibration_elipse.py) throws a shape error, requiring a recalibration to recover. Please fix this bug so that calibration data is only changed after a successful calibration, and not reset when calibration was never started.


REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!


Console output here:

[INFO] Config Saved Successfully
[INFO] You have app version [EyeTrackApp 0.2.6] installed. Please update to [EyeTrackApp 0.2.4] for the newest features.
[DEBUG] Registering listener <bound method OSCManager.update of <osc.osc.OSCManager object at 0x000001BE22AEAE90>>
[DEBUG] Registering listener <bound method CameraWidget.on_config_update of <camera_widget.CameraWidget object at 0x000001BE20F66B50>>
[DEBUG] Registering listener <bound method CameraWidget.on_config_update of <camera_widget.CameraWidget object at 0x000001BE22AD5090>>
[INFO] Setting up OSC sender
[INFO] Setting up OSC receiver
[INFO] OSC Listening on ('127.0.0.1', 9001)
[WARN] Capture source http://192.168.31.231 not found, retrying...
[WARN] Capture source http://192.168.31.53 not found, retrying...
Exception in thread Thread-4 (run):
Traceback (most recent call last):
  File "C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "C:\\Users\\Administrator\\Documents\\OpenSourceProject\\EyeTrackVR\\EyeTrackApp\\eye_processor.py", line 753, in run
    self.ALGOSELECT()  # run our algos in priority order set in settings
    ^^^^^^^^^^^^^^^^^
  File "C:\\Users\\Administrator\\Documents\\OpenSourceProject\\EyeTrackVR\\EyeTrackApp\\eye_processor.py", line 562, in ALGOSELECT
    self.firstalgo()
  File "C:\\Users\\Administrator\\Documents\\OpenSourceProject\\EyeTrackVR\\EyeTrackApp\\eye_processor.py", line 387, in LEAPM
    self.out_x, self.out_y, self.avg_velocity = cal.cal_osc(self, self.rawx, self.rawy, self.angle)
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\\Users\\Administrator\\Documents\\OpenSourceProject\\EyeTrackVR\\EyeTrackApp\\osc_calibrate_filter.py", line 239, in cal_osc
    out_x, out_y = self.cal.normalize((cx, cy), (self.config.calib_XOFF, self.config.calib_YOFF))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\\Users\\Administrator\\Documents\\OpenSourceProject\\EyeTrackVR\\EyeTrackApp\\utils\\calibration_elipse.py", line 151, in normalize
    p_rot = self.evecs.T @ p_centered
            ~~~~~~~~~~~~~^~~~~~~~~~~~
ValueError: matmul: Input operand 0 does not have enough dimensions (has 0, gufunc core with signature (n?,k),(k,m?)->(n?,m?) requires 1)





TO REPRODUCE

  1. Connect camera.
  2. Directly click “Stop Calibration” (do not click “Start Calibration” first).
  3. Observe that calibration parameters in eyetrack_setting.json are reset to zeros.
  4. Later use results in ValueError and prevents further operation until new calibration is performed.
    

EXPECTED BEHAVIOUR

Calibration parameters should not be modified unless a calibration process is performed (i.e., after a “Start Calibration”). Clicking “Stop Calibration” without a prior calibration should not change parameters or break existing calibration.


SCREENSHOTS

N/A


ADDITIONAL CONTEXT

The bug makes the software unable to function until recalibration. Please fix stop calibration logic and add parameter validity checks in calibration code.


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions