Skip to content

fix(zyra-eyes): add adaptive mouse-like smooth cursor engine - #69

Merged
sonoxo merged 3 commits into
mainfrom
fix/zyra-eyes-mouse-smoothness
Sep 1, 2026
Merged

sonoxo merged 3 commits into
mainfrom
fix/zyra-eyes-mouse-smoothness

Conversation

@sonoxo

@sonoxo sonoxo commented Sep 1, 2026

Copy link
Copy Markdown
Owner

ZYRA Eyes mouse-smoothness fix

The current full controller updates the pointer at gaze/camera-frame cadence using fixed EMA smoothing and a hard pixel deadzone, which creates visible stepping and lag.

Fix

  • adds zyra_smooth_controller.py
  • One Euro adaptive gaze filtering: stronger jitter suppression while nearly stationary, lower latency during intentional fast gaze shifts
  • independent high-rate cursor actuator (120 Hz default, up to 240 Hz)
  • velocity limiting plus smooth acceleration/deceleration instead of hard coordinate jumps
  • requests 60 fps camera capture when supported
  • removes the normal hard deadzone from the primary motion path; uses a tiny sub-pixel hold radius instead
  • retains calibration profiles, one-eye selection, dwell click, control dock, scrolling, drag/drop, keyboard/navigation commands, pause/resume, audit, explicit local authorization, and PyAutoGUI failsafe
  • adds performance/tuning documentation and dedicated CI invariants

Boundary

This remains a local accessibility controller. Demo mode is default. Native control still requires the existing owner sentinel plus --native --approve; no remote-control server or hidden network channel is added.

Important sensor limit

The high-rate actuator makes cursor motion visually continuous between webcam samples, but it does not turn a 30–60 fps webcam into a dedicated high-rate infrared eye tracker. Accuracy still depends on calibration, pupil visibility, lighting, camera placement, and head stability.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T10:40:34.442278Z 5c7c5d0 PR opened
🔒 Security Review Completed 2026-09-01T10:39:13.308483Z 5c7c5d0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sonoxo
sonoxo merged commit ab7ffcf into main Sep 1, 2026
7 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c7c5d04cf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


def set_paused(self, paused: bool) -> None:
with self.lock:
self.paused = bool(paused)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resynchronize the actuator when resuming

When the operator moves the physical mouse while gaze control is paused, self.position retains the pre-pause coordinates. Resuming only clears this flag, so the next actuator tick issues a moveTo from that stale internal position, causing the pointer to jump back before moving toward the current gaze target. Read the actual pointer position and reset velocity when transitioning from paused to active.

Useful? React with 👍 / 👎.

Comment on lines +320 to +321
if motion is not None:
motion.set_paused(True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Finish drag motion before pausing for the dock

When a user looks at a drop destination and then immediately enters the dock, the asynchronous actuator can still be approaching state.last_content_target; this pause freezes it at the lagging physical position. After the dock dwell, base.perform_command("DRAG", ...) handles an active drag by calling mouseUp() without moving to the supplied target, so the item is dropped at that stale position. Synchronize the actuator to the last content target before pausing or explicitly move there before releasing the drag.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant