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

Screen and Device local coordinates #31

Merged
merged 1 commit into from
Feb 1, 2018

Conversation

pozdnyakov
Copy link

@pozdnyakov pozdnyakov commented Jan 31, 2018

This patch introduces definition for 'device' and 'screen'
coordinate systems as possible local coordinates options
for spatial sensor classes.

The SpatialSensorOptions dictionary and the
"construct spatial sensor object" are added, so that
the client can set the local coordinate system for a
Sensor instance from the constructor.

This patch is a part of fix for w3c/sensors#257


Preview | Diff

@pozdnyakov
Copy link
Author

@kenchris, @alexshalamov, @anssiko PTAL

index.bs Outdated

<img src="images/accelerometer_coordinate_system.png" srcset="images/accelerometer_coordinate_system.svg" style="display: block;margin: auto;" alt="Accelerometer coordinate system.">
The [=local coordinate system=] for the spatial sensor classes in this specification

Choose a reason for hiding this comment

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

defined in this specification

index.bs Outdated
can be defined as either [=device coordinate system=] or [=screen coordinate system=].

The <dfn export>device coordinate system</dfn> is defined as a three dimensional
Cartesian coordinate system (x, y, z) which is bound to the physical device.

Choose a reason for hiding this comment

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

, before which (that is English grammar, if you don't like ", which", then use "that"

index.bs Outdated
The <dfn export>device coordinate system</dfn> is defined as a three dimensional
Cartesian coordinate system (x, y, z) which is bound to the physical device.
For devices with display the origin of the [=device coordinate system=] is in the center
of the device display. If the device is held in a default position the Y-axis points

Choose a reason for hiding this comment

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

"a default position" sounds wake... will it have multiple? in its default position

index.bs Outdated
the X-axis points towards the right of the [=dom-screen=] and Z-axis is a
vector product of X and Y axes and it points towards the [=dom-screen=] viewer.

The main difference between the [=device coordinate system=] and the [=screen coordinate system=]

Choose a reason for hiding this comment

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

, before is

index.bs Outdated
vector product of X and Y axes and it points towards the [=dom-screen=] viewer.

The main difference between the [=device coordinate system=] and the [=screen coordinate system=]
is that the [=screen coordinate system=] always follows [=dom-screen=] orientation, i.e. it

Choose a reason for hiding this comment

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

follows THE

index.bs Outdated
The main difference between the [=device coordinate system=] and the [=screen coordinate system=]
is that the [=screen coordinate system=] always follows [=dom-screen=] orientation, i.e. it
will swap X and Y axes in relation to the device if the [=current orientation type=]
changes. In contrast, the [=device coordinate system=] will always remain the same.

Choose a reason for hiding this comment

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

Should you mention use-cases?

Copy link
Author

Choose a reason for hiding this comment

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

yep, and we're also planning to add some illustrations, however I'd like it to be in follow up patches.

index.bs Outdated
enum LocalCoordinateSystem { "device", "screen" };

dictionary SpatialSensorOptions : SensorOptions {
LocalCoordinateSystem localCoordinates = "device";

Choose a reason for hiding this comment

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

I think it might be clearer if we call it "referenceFrame" or so?

   LocalCoordinateSystem referenceFrame = "device";

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for this comment! it is exactly what I'm thinking right now :) also we can probably mention at w3c/sensors#340, that 'local coordinate system' represents frame of reference for the sensor readings..

@pozdnyakov
Copy link
Author

@kenchris I've updated the patch, could you take another look?

index.bs Outdated

The <dfn export>device coordinate system</dfn> is defined as a three dimensional
Cartesian coordinate system (x, y, z), which is bound to the physical device.
For devices with display the origin of the [=device coordinate system=] is in the

Choose a reason for hiding this comment

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

For devices with A display COMMA, the origin

is REMOVE IN the center

index.bs Outdated
The <dfn export>device coordinate system</dfn> is defined as a three dimensional
Cartesian coordinate system (x, y, z), which is bound to the physical device.
For devices with display the origin of the [=device coordinate system=] is in the
center of the device display. If the device is held in its default position the Y-axis

Choose a reason for hiding this comment

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

position, COMMA

index.bs Outdated
For devices with display the origin of the [=device coordinate system=] is in the
center of the device display. If the device is held in its default position the Y-axis
points towards the top of the display, the X-axis points towards the right of the
display and Z-axis is a vector product of X and Y axes and it points towards the

Choose a reason for hiding this comment

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

... is THE vector product of the X- and Y-axes and it points OUTWARDS from the display, and towards the VIEWER.

index.bs Outdated
@@ -33,6 +33,10 @@ urlPrefix: https://w3c.github.io/sensors; spec: GENERIC-SENSOR
text: default sensor
text: construct a sensor object; url: construct-sensor-object
text: sensor type
urlPrefix: https://w3c.github.io/screen-orientation; spec: SCREEN-ORIENTATION
type: dfn
text: current orientation type
Copy link
Member

Choose a reason for hiding this comment

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

text: current orientation type, url: dfn-current-orientation-type

(Or whatever it takes to fix the link.)

index.bs Outdated
display viewer.

The <dfn export>screen coordinate system</dfn> is defined as a three dimensional
Cartesian coordinate system (x, y, z), which is bound to [=dom-screen=].

Choose a reason for hiding this comment

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

to THE

index.bs Outdated
Cartesian coordinate system (x, y, z), which is bound to [=dom-screen=].
The origin of the [=screen coordinate system=] is in the center
of the [=dom-screen=]. The Y-axis always points towards the top of the [=dom-screen=],
the X-axis points towards the right of the [=dom-screen=] and Z-axis is a

Choose a reason for hiding this comment

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

a/THE

index.bs Outdated
Reference Frame {#reference-frame}
----------------

The [=local coordinate system=] for the [=spatial sensor=] classes defined

Choose a reason for hiding this comment

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

Maybe

The reference frame for the sensor classes defined in this specification, is a local coordinate system, which can be defined as either THE device coordinate system, or THE screen coordinate system

Choose a reason for hiding this comment

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

Reference frame also includes time, while 'local coordinate system' omits time component.

Copy link
Author

Choose a reason for hiding this comment

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

can be rephrased: "The reference frame for the sensor classes defined in this specification,
is expressed in a [=local coordinate system=]"

index.bs Outdated
urlPrefix: https://w3c.github.io/screen-orientation; spec: SCREEN-ORIENTATION
type: dfn
text: current orientation type
text: dom-screen; url: dom-screen

Choose a reason for hiding this comment

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

I think, if text and link are the same, you can leave just 'text:' part

Copy link
Member

Choose a reason for hiding this comment

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

Usually that works, but in this case text: current orientation type creates a link to https://w3c.github.io/screen-orientation/#current-orientation-type that does not exist. Should go to https://w3c.github.io/screen-orientation/#dfn-current-orientation-type thus explicit text: current orientation type; url: dfn-current-orientation-type needed. ReSpec bug perhaps.

index.bs Outdated
Reference Frame {#reference-frame}
----------------

The [=local coordinate system=] for the [=spatial sensor=] classes defined

Choose a reason for hiding this comment

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

Reference frame also includes time, while 'local coordinate system' omits time component.

enum LocalCoordinateSystem { "device", "screen" };

dictionary SpatialSensorOptions : SensorOptions {
LocalCoordinateSystem referenceFrame = "device";

Choose a reason for hiding this comment

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

I would prefer LocalCoordinateSystem coordinateSystem = "device";

Copy link
Author

Choose a reason for hiding this comment

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

IMO, referenceFrame would be more understandable for the API user (even though coordinateSystem is a more accurate term from the physics point of view). WDYT?

index.bs Outdated

The main difference between the [=device coordinate system=] and the [=screen coordinate system=],
is that the [=screen coordinate system=] always follows the [=dom-screen=] orientation,
i.e. it will swap X and Y axes in relation to the device if the [=current orientation type=]

Choose a reason for hiding this comment

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

should we use term from generic sensor spec? Instead of saying 'swap' use remap readings?

Copy link
Author

@pozdnyakov pozdnyakov Feb 1, 2018

Choose a reason for hiding this comment

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

here is no remap happening, we're just describing the coordinate system per se (apart from readings transformation)

@kenchris
Copy link

kenchris commented Feb 1, 2018

"In physics, a frame of reference (or reference frame) consists of an abstract coordinate system and the set of physical reference points that uniquely fix (locate and orient) the coordinate system and standardize measurements." (wikipedia)

I don't think it necessarily includes times, though I does in Einsteinian relativity.

In a way, a 4 component system with time included is also a coordinate system

@kenchris
Copy link

kenchris commented Feb 1, 2018

This patch introduces definition for 'device' and 'screen'
coordinate systems as possible local coordinates options
for spatial sensor classes.

The `SpatialSensorOptions` dictionary and the
"construct spatial sensor object" are added, so that
the client can set the local coordinate system for a
Sensor instance from the constructor.
@pozdnyakov
Copy link
Author

PTAL at the updated patch

@pozdnyakov
Copy link
Author

From https://www.quora.com/What-is-a-reference-frame-and-how-does-one-determine-where-a-frame-of-reference-begins-and-where-it-ends :

A reference frame is really just a coordinate system for spacetime, i.e., history. It has to take every event in history and assign it time (t) and space (x, y, z or the like) coordinates.

@kenchris
Copy link

kenchris commented Feb 1, 2018

Lgtm

Copy link

@kenchris kenchris left a comment

Choose a reason for hiding this comment

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

Ah have to make a review and not comments

@@ -33,6 +33,10 @@ urlPrefix: https://w3c.github.io/sensors; spec: GENERIC-SENSOR
text: default sensor
text: construct a sensor object; url: construct-sensor-object
text: sensor type
urlPrefix: https://w3c.github.io/screen-orientation; spec: SCREEN-ORIENTATION
Copy link

Choose a reason for hiding this comment

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

Trying to find out how I approve :)

@pozdnyakov
Copy link
Author

Thank you for review!

@pozdnyakov pozdnyakov merged commit a7455d3 into w3c:gh-pages Feb 1, 2018
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.

4 participants