Skip to content

BUG: Wrong Resource Path #147

@m-RNA

Description

@m-RNA

PROBLEM DESCRIPTION

The resource_path() function in EyeTrackApp/utils/misc_utils.py fails to correctly resolve asset file paths in development mode, causing FileNotFoundError when launching overlay programs that depend on resources like Purple_Dot.png.

ROOT CAUSE

The function uses Path(".") as the base path in development mode, which resolves relative to the current working directory (project root). However, actual resources are located in the EyeTrackApp/ subdirectory, making relative paths fail when the application is launched from the project root.

Example:

  • Current working directory: C:\Users\...\EyeTrackVR-copy\
  • Resource location: C:\Users\...\EyeTrackVR-copy\EyeTrackApp\Tools\assets\Purple_Dot.png
  • Resolved path: .\tools\assets\Purple_Dot.png ❌ (relative to project root, not EyeTrackApp)

REQUESTED INFORMATION

TO REPRODUCE

  1. Clone the repository
  2. Run from project root: poetry run .\EyeTrackApp\eyetrackapp.py
  3. Tracking mode
  4. Observe error:
C:\Users\Administrator\Documents\OpenSourceProject\EyeTrackVR-copy> poetry run .\EyeTrackApp\eyetrackapp.py
[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 0x00000215B2C5EC90>>
[DEBUG] Registering listener <bound method CameraWidget.on_config_update of <camera_widget.CameraWidget object at 0x00000215B2B76510>>
[DEBUG] Registering listener <bound method CameraWidget.on_config_update of <camera_widget.CameraWidget object at 0x00000215B21F2890>>
[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](vscode-file://vscode-app/c:/Users/Administrator/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/workbench/workbench.html) not found, retrying...
[WARN] Capture source [http://192.168.31.53](vscode-file://vscode-app/c:/Users/Administrator/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/workbench/workbench.html) not found, retrying...
[ERROR] Please Calibrate Eye(s).
Exception in thread center_overlay_calibrate:
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-copy\EyeTrackApp\osc_calibrate_filter.py", line 67, in run
self.Result = self.Callable(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\Documents\OpenSourceProject\EyeTrackVR-copy\EyeTrackApp\osc_calibrate_filter.py", line 131, in center_overlay_calibrate
subprocess.Popen([overlay_path, "center"], cwd=str(tools_dir))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1026, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1538, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] 系统找不到指定的文件。
[INFO] Config Saved Successfully

Welcome to the EyeTrackVR OpenVR Calibration Overlay!
[INFO] Calibrate Center Point Only:
[INFO] Calibrating...
C:\Users\Administrator\Documents\OpenSourceProject\EyeTrackVR-copy\Purple_Dot.png
Welcome to the EyeTrackVR OpenVR Calibration Overlay!
[INFO] Calibrate Center Point Only:
[INFO] Calibrating...
{
"message_id" : 1,
"result" : 25,
"type" : "set_overlay_from_file_response"
}

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