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

Note gravity and linear accelerometer relationship #59

Merged
merged 1 commit into from
Feb 23, 2021
Merged

Conversation

anssiko
Copy link
Member

@anssiko anssiko commented Feb 12, 2021

index.bs Outdated
@@ -216,6 +216,8 @@ The {{GravitySensor}} class is an {{Accelerometer}}'s subclass. The {{GravitySen

The <dfn>gravity</dfn> is a force that attracts an object to the center of the earth, or towards any other physical object having mass.

Note: The definition of [=gravity=] assumes that the device is not in free fall for more than a short period of time. The relationship between [=gravity=] and [=linear acceleration=] is discussed in [[MOTION-SENSORS#gravity-and-linear-acceleration]].
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to actually change the definition of gravity instead of just adding a note. E.g.

The <dfn>gravity</dfn> is the component of the device's acceleration that prevents its velocity from increasing toward nearby masses. Devices in free fall for more than a short period of time MAY compute incorrect values for the gravity.

or similar.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jyasskin thanks for the proposal. Could we bake that into the existing approximated layman definition and make the "free fall" part a note since I think it is not a testable assertion in this context (and as a consequence "MAY" => "can" to avoid RFC2119 terms in an informative note)?

Here's the updated proposal:

The <dfn>gravity</dfn> is the component of the device's acceleration that prevents its velocity from increasing toward nearby masses.
For most applications, gravity is approximated as a force that attracts an object to the center of the Earth, or towards any other physical object having mass.

Note: Devices in free fall for more than a short period of time can compute incorrect values for the gravity.
The relationship between [=gravity=] and [=linear acceleration=] is discussed in [[MOTION-SENSORS#gravity-and-linear-acceleration]]

Native speakers: do we say "The gravity" to make a point this is the definition in the context of this spec, or drop The?

@reillyeon thoughts?

Copy link
Member

@jyasskin jyasskin Feb 18, 2021

Choose a reason for hiding this comment

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

I think the main issue is fixed with your updated proposal, so feel free to disagree with the following and merge when you're ready.

  • I put the "MAY compute incorrect values" in normative text because, if you have tests for the device correctly computing gravity in various situations, and one of those situations is free-fall, the normative text needs to give permission for that test to fail.
  • The two normative sentences in the updated proposal imply opposite directions for gravity. "the component of the device's acceleration" points up, and the "force that attracts an object" points down. Based on the spec's examples, I think gravity points up, so you should keep only the first sentence.
  • I would use "the gravity" (as you have) to more-clearly say that we're talking about the value returned by the GravitySensor, rather than trying to compete with general relativity. :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @jyasskin, you convinced me to include the "may compute incorrect values" in normative text :-)

With https://w3c.github.io/accelerometer/#reference-frame (and
https://w3c.github.io/accelerometer/#example-1cf0e3e6) we have an upward vectors are positive convention for gravity here.

I updated the PR accordingly, PTAL @reillyeon

Base automatically changed from master to main February 23, 2021 02:46
@anssiko
Copy link
Member Author

anssiko commented Feb 23, 2021

@jyasskin thanks for the review! Merging.

@anssiko anssiko merged commit a2d42b0 into main Feb 23, 2021
@anssiko anssiko deleted the gravity-note branch February 23, 2021 16:13
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.

Explain how the implementation separates gravity from linear acceleration
2 participants