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

Idle detection#1187 #1652

Merged
merged 7 commits into from
Sep 23, 2023
Merged

Idle detection#1187 #1652

merged 7 commits into from
Sep 23, 2023

Conversation

dennisguse
Copy link
Member

@dennisguse dennisguse commented Jul 31, 2023

So far, idle was considered if the speed dropped below a certain criteria.
However, speed from GPS is noisy and especially for slow moving activities (like hiking), this resulted in a lot of idle detection.

This PR changes the idle detection to "time without movement" (distance covered at least minRecordingThreshold).

TODO:

  • import/export KML (export TrackPoint.Type)
  • import/export GPX (speed=0.0) not supported (for now) due to lack of GPS coordinates
  • extend ExportImport test
  • ... check TrackStatisticsUpdater is completely implemented

For legacy formats (aka prior to this change), we may create new idle TrackPoints.

NOTE: this is a breaking change as it changes the database.
Statistics for existing tracks will not be updated (only on import).

@dennisguse dennisguse added the enhancement New feature or request label Jul 31, 2023
@dennisguse dennisguse force-pushed the idleDetection#1187 branch 6 times, most recently from 3a1f26c to a4930ee Compare August 3, 2023 17:31
@dennisguse dennisguse force-pushed the idleDetection#1187 branch 4 times, most recently from f3c78c2 to fcfaa51 Compare August 13, 2023 21:16
@dennisguse dennisguse force-pushed the idleDetection#1187 branch 3 times, most recently from 4899ac9 to 0d4745a Compare August 26, 2023 17:15
@dennisguse
Copy link
Member Author

@pstorch @rgmf Any opinions about this?

@pstorch
Copy link
Member

pstorch commented Aug 26, 2023

@dennisguse let's see if I can bend my head around this issue.

@dennisguse
Copy link
Member Author

It's about not using the speed to determine if the user became idle, but a timeout (aka no distance traveled since...).

My biggest issue was the KML/GPX spec (again).

@dennisguse dennisguse force-pushed the idleDetection#1187 branch 2 times, most recently from 1532919 to 4244da1 Compare August 27, 2023 18:13
@pstorch
Copy link
Member

pstorch commented Aug 27, 2023

So far it makes sense, but I don't have a full picture (for example on possible side effects). Maybe an extended test period with the nightlies?

@dennisguse
Copy link
Member Author

@pstorch I also expect some fancy behavior.
Merging it into main for the nightly would basically block us from creating new releases without this functionality.
That feels kind of ugly - especially as the change is relatively large.

I am not really sure how to continue here.
Would moving the nightly build to this branch for some days/weeks be an option?
Is it possible to then switch to main again?

@pstorch
Copy link
Member

pstorch commented Aug 28, 2023

@dennisguse have switched the OpenTracks nightly branch to idleDetection#1187, let's see. Haven't done it before for any other app.

@pstorch
Copy link
Member

pstorch commented Sep 10, 2023

@dennisguse have you got any feedback from this PR and nightly? For me it's working. Recorded a few tracks and some pause got recognized. I can see it now easily with the OSMDashboard trackpoints debug option. 😉
I'm thinking about placing "pause" icons on the Map.

@dennisguse
Copy link
Member Author

@pstorch Sounds great!
I haven't used it that much; was knocked out for some days and now I have no time :D
What I want to build before merging this is the voice announcement, which is played when idle starts.
This way it is easier to figure out what is happening.
And I was thinking about showing idle in the UI somehow.
I would love to get this done until the end of September.

@pstorch
Copy link
Member

pstorch commented Sep 18, 2023

@dennisguse I'm experimenting with showing the idle/pause trackpoints in the OSMDashboard nightly. Using the previous trackpoints location. So far it looks reasonable.

@pstorch
Copy link
Member

pstorch commented Sep 23, 2023

@dennisguse build fails after rebase

@dennisguse
Copy link
Member Author

androidx.mediarouter upgrade introduced dependency conflicts and the tests are broken due to recent pull request.
The first thing is fixed by downgrading.

@dennisguse
Copy link
Member Author

We now have voice announcement when the user becomes idle (disabled by default).
From my perspective, this is ready to go into main.

@pstorch merge or do you see any showstoppers?

@pstorch
Copy link
Member

pstorch commented Sep 23, 2023

It looks good to me. I recorded a few tracks. One time I got a wrong idle detection where I was a bit slow, but I guess I just have to increase the threshold a bit.

@dennisguse
Copy link
Member Author

I was just doing a walk and 10s doesn't work too well :D
That's something, the users will have to figure out...

@dennisguse dennisguse merged commit 516b89a into main Sep 23, 2023
3 checks passed
@dennisguse dennisguse deleted the idleDetection#1187 branch September 23, 2023 17:23
@pstorch
Copy link
Member

pstorch commented Oct 8, 2023

I really like the idle announcement. 🙂

@dennisguse
Copy link
Member Author

I also enjoy it a lot.
Gives me something to look forward to at every red traffic light ;)

PS also the pause visualization shows quite nicely all the traffic lights :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants