Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automation support via WebDriver #124

Merged
merged 1 commit into from
Jan 4, 2024
Merged

Add automation support via WebDriver #124

merged 1 commit into from
Jan 4, 2024

Commits on Jan 4, 2024

  1. Add automation support via WebDriver

    This PR integrates with the automation concepts defined in
    https://w3c.github.io/sensors/#automation to allow providing motion or
    orientation readings via virtual sensors through the WebDriver extension
    commands defined there.
    
    IMPORTANT: This does not mean that this specification requires
    implementations to support the Generic Sensor API specification and its
    derived specifications. Only the Automation section is being referenced, and
    when necessary some algorithms and definitions are being duplicated here,
    especially for Device Motion automation.
    
    The definitions of the "accelerometer", "linear-acceleration", "gyroscope",
    "absolute-orientation", and "relative-orientation" virtual sensor types have
    been moved here from their original specifications. As suggested in #124 and
    similarly to what has been discussed in PRs #121 and #123, since this
    specification is further along the Rec track and is implemented by more
    engines, it makes sense to have the exported definitions here and reference
    them from the other specs instead.
    
    Device Motion:
    - Readings are controlled via the "accelerometer", "linear-acceleration" and
      "gyroscope" virtual sensor types.
    
    Device Orientation:
    - The "absolute-orientation" and "relative-orientation" virtual sensor types
      are defined in this specification, along with a parsing algorithm that
      reads alpha, beta and gamma doubles.
      Compared to device motion, however, we have an additional problem in that
      device orientation data is provided in Euler angles and Orientation Sensor
      uses quaternions.
      The idea is to parse readings by reading alpha/beta/gamma keys from the
      WebDriver extension command and use them in the "fire orientation event"
      algorithm and skip using quaternions altogether. The Orientation Sensor
      spec can then augment the "parse orientation data reading" algorithm with
      the required steps to both 1) accept a "quaternion" key in the WebDriver
      extension command (and convert it to Euler angles as well) and 2) derive a
      quaternion from the alpha/beta/gamma Euler angles.
    
    Fixes #122.
    rakuco committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    ea74dc7 View commit details
    Browse the repository at this point in the history