Closed
Bug 805965
Opened 12 years ago
Closed 12 years ago
Geolocation fix "jerks around"
Categories
(Core :: DOM: Device Interfaces, defect, P2)
Tracking
()
People
(Reporter: cjones, Assigned: dougt)
Details
Attachments
(1 file, 3 obsolete files)
9.35 KB,
patch
|
jdm
:
review+
|
Details | Diff | Splinter Review |
STR
(1) Open Maps app
(2) Initially, we get a coarse fix. IP or wifi positioning?
(3) Wait for a precise GPS fix
After the GPS fix, I see the current location in Maps "jerk" back and forth between the coarse fix in (2) and the precise fix in (3).
I would expect that once a high-precision locator becomes available, we use it exclusively and ignore or disable low-precision sources.
Reporter | ||
Comment 1•12 years ago
|
||
Suggest blocking-basecamp for major usability issue. This makes geolcation in the Maps app pretty much useless.
Assignee | ||
Comment 2•12 years ago
|
||
The wifi/ip position and the gps position are both being sent to the document. We use to have code to filter/blend locations.
I agree that it should be fixed for basecamp. Assigning. I can look at it shortly.
Assignee: nobody → doug.turner
Updated•12 years ago
|
blocking-basecamp: ? → +
Priority: -- → P2
Assignee | ||
Comment 3•12 years ago
|
||
It would be really cool if someone could try this patch out
Attachment #677171 -
Flags: review?
Comment 4•12 years ago
|
||
Works great!
Assignee | ||
Comment 5•12 years ago
|
||
Comment on attachment 677171 [details] [diff] [review]
patch v.1
Review of attachment 677171 [details] [diff] [review]:
-----------------------------------------------------------------
jdm, do you think you can take a look?
Attachment #677171 -
Flags: review? → review?(josh)
Comment 6•12 years ago
|
||
Comment on attachment 677171 [details] [diff] [review]
patch v.1
Review of attachment 677171 [details] [diff] [review]:
-----------------------------------------------------------------
I'd like somebody else to sign off on the math; it went over my head :/
::: dom/src/geolocation/nsGeolocation.cpp
@@ +709,5 @@
> }
> return NS_OK;
> }
>
> +PRBool
Plain old bool, please, and associate return value changes.
@@ +716,5 @@
> + if (!aSomewhere) {
> + return false;
> + }
> +
> + if (mProviders.Count() == 1 || mLastPosition == nullptr) {
!mLastPosition
@@ +722,5 @@
> + }
> +
> + nsresult rv;
> + DOMTimeStamp oldTime;
> + rv = mLastPosition->GetTimestamp(&oldTime);
Do you intend to do anything with oldTime?
@@ +744,5 @@
> + NS_ENSURE_SUCCESS(rv, PR_FALSE);
> +
> +
> + DOMTimeStamp newTime;
> + rv = aSomewhere->GetTimestamp(&newTime);
Were you going to be using this, too?
@@ +779,5 @@
> + (cos(rNewLat) * cos(rOldLat) * cos(rOldLon - rNewLon)) ) * 6378137;
> +
> + // The threshold is when the distance between the two positions exceeds the
> + // worse (larger value) of the two accuracies.
> + double max_accuracy = PR_MAX(oldAccuracy, newAccuracy);
NS_MAX
Attachment #677171 -
Flags: review?(josh) → review+
Assignee | ||
Comment 7•12 years ago
|
||
Kan-Ru, would you mind also testing this patch? This is much more straight forward and probably works just fine.
Attachment #677171 -
Attachment is obsolete: true
Comment 8•12 years ago
|
||
Will the old "better" position expire? If I get a accurate fix via gps then go into a building, all later updates from IP positioning will be discarded and I will not get any update.
Also the large movement case could happen in real life. Imagine that I get a accurate fix, then I take the subway, on the subway I have wifi so I could get a coarse location.
Assignee | ||
Comment 9•12 years ago
|
||
Comment on attachment 677666 [details] [diff] [review]
patch v.2
That's fair.
we should use patch v.1. bz said he wanted comments about the math used. We should also look at the time and expire as Kan-Ru suggests.
Attachment #677666 -
Flags: review-
Assignee | ||
Comment 10•12 years ago
|
||
Attachment #677666 -
Attachment is obsolete: true
Attachment #678799 -
Flags: review?(bzbarsky)
![]() |
||
Comment 11•12 years ago
|
||
Comment on attachment 678799 [details] [diff] [review]
patch v.2
This looks good.
It might still make sense to mention that this comes out of applying the spherical law of cosines to the triangle formed by our two points and the north pole.
Attachment #678799 -
Flags: review?(bzbarsky) → review+
Comment 12•12 years ago
|
||
Please address comment 6 before landing.
Assignee | ||
Comment 13•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/30b340a71112
https://hg.mozilla.org/releases/mozilla-aurora/rev/db23dcb2f68d
status-firefox18:
--- → fixed
status-firefox19:
--- → fixed
Assignee | ||
Updated•12 years ago
|
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 14•12 years ago
|
||
(In reply to Josh Matthews [:jdm] from comment #6)
> Comment on attachment 677171 [details] [diff] [review]
> patch v.1
>
> Review of attachment 677171 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> I'd like somebody else to sign off on the math; it went over my head :/
>
> ::: dom/src/geolocation/nsGeolocation.cpp
> @@ +709,5 @@
> > }
> > return NS_OK;
> > }
> >
> > +PRBool
>
> Plain old bool, please, and associate return value changes.
Silly you, you still missed this :)
Assignee | ||
Comment 15•12 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/d84a2be98735
https://hg.mozilla.org/mozilla-central/rev/ed13d73c61bb
backed out for bug 690913.
Status: RESOLVED → REOPENED
status-firefox18:
fixed → ---
status-firefox19:
fixed → ---
Resolution: FIXED → ---
Comment 16•12 years ago
|
||
We recently disabled test_geolocation.js due to intermittent failure (we're enabling webAPI tests sometime tomorrow or Thursday on tbpl): https://hg.mozilla.org/integration/mozilla-inbound/rev/a22328aa1130#l2.9
Could this be the cause?
Assignee | ||
Comment 17•12 years ago
|
||
I don't think so.. It's a real bug (yeah!!! for regression tests)
I am trying out this:
https://tbpl.mozilla.org/?tree=Try&rev=7208a31a6f90
Comment 18•12 years ago
|
||
The patch at https://hg.mozilla.org/try/rev/c367403ef2c0 should probably update mIsFirstUpdate.
Assignee | ||
Comment 19•12 years ago
|
||
a bit more involved.
Attachment #678799 -
Attachment is obsolete: true
Attachment #679469 -
Flags: review?(josh)
Comment 20•12 years ago
|
||
Comment on attachment 679469 [details] [diff] [review]
patch v.3
Review of attachment 679469 [details] [diff] [review]:
-----------------------------------------------------------------
The delta check ensures that even if a user is on the move and keeps receiving positions with strictly worse accuracy than the cached value, a long-running app using watchPosition will eventually receive an update, right? r=me if that's the case.
::: dom/src/geolocation/nsGeolocation.cpp
@@ +518,5 @@
> + // in the case when newly detected positions are all less accurate than the cached one.
> + //
> + // Fixes bug 596481
> + if (mIsFirstUpdate || aIsBetter) {
> + mIsFirstUpdate = PR_FALSE;
One day we'll fix this nervous PR tic of yours.
Attachment #679469 -
Flags: review?(josh) → review+
Comment 21•12 years ago
|
||
Try run for c565b9be1ddf is complete.
Detailed breakdown of the results available here:
https://tbpl.mozilla.org/?tree=Try&rev=c565b9be1ddf
Results (out of 17 total builds):
failure: 17
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/dougt@mozilla.com-c565b9be1ddf
Comment 22•12 years ago
|
||
Try run for c565b9be1ddf is complete.
Detailed breakdown of the results available here:
https://tbpl.mozilla.org/?tree=Try&rev=c565b9be1ddf
Results (out of 18 total builds):
failure: 18
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/dougt@mozilla.com-c565b9be1ddf
Assignee | ||
Comment 23•12 years ago
|
||
Comment 24•12 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Assignee | ||
Comment 25•12 years ago
|
||
status-firefox18:
--- → fixed
status-firefox19:
--- → fixed
Comment 26•12 years ago
|
||
(In reply to :Ms2ger from comment #14)
> (In reply to Josh Matthews [:jdm] from comment #6)
> > Comment on attachment 677171 [details] [diff] [review]
> > patch v.1
> >
> > Review of attachment 677171 [details] [diff] [review]:
> > -----------------------------------------------------------------
> >
> > I'd like somebody else to sign off on the math; it went over my head :/
> >
> > ::: dom/src/geolocation/nsGeolocation.cpp
> > @@ +709,5 @@
> > > }
> > > return NS_OK;
> > > }
> > >
> > > +PRBool
> >
> > Plain old bool, please, and associate return value changes.
>
> Silly you, you still missed this :)
And managed to miss it again!
You need to log in
before you can comment on or make changes to this bug.
Description
•