-
Hello people!
I've found a surprising way top count steps implemented in JS: https://github.com/alexgibson/shake.js/
Some people did a validation study here: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6219786/
I have looked at the code and it's basically a threshold on the difference between two samples. I doubt this is generalisable. In fact, the authors of the paper had to manually calibrate the threshold on each phone and walking style.
I'll leave it here as a curiosity.
-
Hi fanoush,
the time is meant to be in ms and it can be since the start of the system (the most common case) or since the start of the algorithm. If you don't have a clock, you can just feed a variable which you increment of +sampling_frequency each time, as you say yourself.
It should be OK to reduce the type it to 32 bits, but there is no check when the clock is reset.
Alternatively, you could just get rid of the timestamp altogether, but whenever time is used later in the algorithm, you need to assume that it has increased of a given period.
-
A followup on this: we have a C implementation of the algorithm, in case anyone wants to import it: https://github.com/Oxford-step-counter/C-Step-Counter
-
about step counting, if you want to take a lower level approach and embed it into the firmware, this is open source and validated: https://github.com/Oxford-step-counter/C-Step-Counter
There are some constants that need to be optimised because they depend on the actual hardware you use and the sampling frequency (we used 50Hz, but probably 10Hz would do anyway). See the instructions in the README. If anyone here wants to try including this in the BangleJS firmware, I'll be happy to help.
-
Hi all,
our open source step counter has been ported to C and can be used in your project!
Here is the repo: https://github.com/Oxford-step-counter/C-Step-CounterThere are some constants that need to be optimised because they depend on the actual hardware you use and the sampling frequency (we used 50Hz, but probably 10Hz would do anyway). See the instructions in the README. If anyone here wants to try including this in the BangleJS firmware, I'll be happy to help!
-
-
Hello,
I've received my BangleJS a couple of days ago and I'm very happy about how easy it is to program. Unfortunately, for my applications, I would need a rather good accuracy for both steps and heart rate. Let's discuss step counting here.
I noticed that the accelerometer does not include embedded step counting and that steps are computed by the Espruino firmware (here?). The algorithm unfortunately is very inaccurate: it waaaaaay over estimates my activity.Do you have plans in this regard? Maybe include an accelerometer with an embedded step counter in the next model (if any) ?
If it helps, we are working on a C implementation of this algorithm specifically for microcontrollers and wearables. I can tell you when it's ready so maybe you could include it in the next firmware.
Cheers.
-
Thanks for the answer!
So, as far as I understand it, the options for this case would be:a) customise the boot app
b) build a widget
c) customise a clock appI didn't realise the widget thing! So I understand that, once installed, a widget is auto-restarted, runs all the time, and will react to events and timers even if the watch is idle.
The pedometer widget is actually the perfect starting point for my case. -
I am still waiting for my watch to be delivered and I am already looking at the docs to understand the programming model!
As far as I understand it, the "apps" one can develop, are pieces of JS code that run when the user taps on their icon. Now, suppose I want to have some background data collection even when the user is outside of my app, how can I allow that? For example, say I would like to log each single step event on a file.
1) are events, like the step event, handled even if the app has been killed?
2) what about timers? will they be kept running?
3) how can I auto-start my app?
4) would customising the boot app work for my case?thanks and congratulations for the great product and idea, I'm a big fan.
-
Hi, I am also looking at hacking the DS-D6, well, actually the Lenovo HX03W. I am a bit disappointed that the accelerometer does not include step counting out of the box!
As for the algorithm I can point at this research we made some time ago exactly with the idea of having an open and validated step counting algorithm. The only problem is that the implementation is either in python or Java, not in C.
If anyone has some time, you could port it to C, the algorithm is quite simple and does not require any strange dependency.
great!
There is a bit of calibration to be done, so it's not just plug and play unfortunately. Happy to help!