lqml/examples/wear-os-gps
2022-07-25 10:09:55 +02:00
..
build-android new example: 'wear-os-gps' (meant for use on e.g. a canoe) 2022-07-03 14:15:07 +02:00
cpp add settings to example 'wear-os-gps' 2022-07-05 17:59:16 +02:00
kml revisions 2022-07-07 15:40:45 +02:00
lisp example 'wear-os-gps': replace 'CircularGauge' with custom one 2022-07-24 23:46:52 +02:00
platforms example 'wear-os-gps': replace 'CircularGauge' with custom one 2022-07-24 23:46:52 +02:00
qml example 'wear-os-gps': small fix for iOS 2022-07-25 10:09:55 +02:00
.gitignore new example: 'wear-os-gps' (meant for use on e.g. a canoe) 2022-07-03 14:15:07 +02:00
app.asd example 'wear-os-gps': replace 'CircularGauge' with custom one 2022-07-24 23:46:52 +02:00
app.pro example 'wear-os-gps': replace 'CircularGauge' with custom one 2022-07-24 23:46:52 +02:00
make.lisp new example: 'wear-os-gps' (meant for use on e.g. a canoe) 2022-07-03 14:15:07 +02:00
readme-build.md example 'wear-os-gps': replace 'CircularGauge' with custom one 2022-07-24 23:46:52 +02:00
readme.md revision of readme 2022-07-25 08:30:08 +02:00

Prepare

Please copy the app template files first:

$ cd ..
$ ./copy.sh wear-os-gps

Info

This is a practical example of displaying both the speed and the whole distance of e.g. a canoe session (only meant for constant altitude values). You probably need to adapt the maximum speed value (km/h) to your personal needs, see settings (swipe up).

An important feature (android only) is keeping the display always on (implemented with the Qt JNI interface). But this also consumes more battery, so you can switch it off in the settings.

The data is automatically logged, and can be accessed with e.g. Device File Explorer from Android Studio (see Help / Find Action...).

The path of the log files is:

/data/data/org.qtproject.example.gps/files/

You can then put those log files in directory kml/logs/ and run

cd kml

ecl -shell kml.lisp

This will generate kmz files of all log files, which can then be viewed using Google Earth (the free desktop app).

A simple Kalman filter is used for the necessary GPS data smoothing.

The UI uses a custom 180° Gauge (and not a CircularGauge, which has deprecated dependencies) for displaying the speed (by default, an average of the latest 5 seconds). Additionally it shows the whole distance and the GPS accuracy in meters.

Run (desktop demo)

lqml run.lisp

Optionally pass -slime to start a Swank server, and connect from Emacs with M-x slime-connect.

During development you can pass -auto, which will releoad all QML files after you made a change to any of them and saved it. For re-initialization after reloading, file lisp/qml-reload/on-reloaded will be loaded.

Closing the window quits the app. If you try to kill it with ctrl-c, you need an additional ctrl-d to exit from ECL. To quit from Slime, do (qq) which is short for (qquit).

Note

Even though this example is made for a WearOS watch, it can also be run on any android/iOS phone (preferably in landscape orientation).