lqml/examples/wear-os-gps
2022-07-05 17:59:16 +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 revision of example 'wear-os-gps' 2022-07-04 12:39:59 +02:00
lisp add settings to example 'wear-os-gps' 2022-07-05 17:59:16 +02:00
platforms/android new example: 'wear-os-gps' (meant for use on e.g. a canoe) 2022-07-03 14:15:07 +02:00
qml add settings to example 'wear-os-gps' 2022-07-05 17:59:16 +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 new example: 'wear-os-gps' (meant for use on e.g. a canoe) 2022-07-03 14:15:07 +02:00
app.pro new example: 'wear-os-gps' (meant for use on e.g. a canoe) 2022-07-03 14:15:07 +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 add settings to example 'wear-os-gps' 2022-07-05 17:59:16 +02:00
readme.md add settings to example 'wear-os-gps' 2022-07-05 17:59:16 +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 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 CircularGauge 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).