Recently I read a article about the Pokewalker and how well developed it was as a pedometer.
https://archive.news.iastate.edu/news/2011/apr/pokewalker
Back in 2015, I was hired to develop a Unity game where the player control the game using a custom-made wearable device called "Wipace". The player would attach the device to his/her foot gear and whenever he/she jumps or move, the device would receive the gyroscope input and send via bluetooth to the device, calculate the input and send using native service to Unity.
So the game identify the variation in the player position and move the character accordly. If the player jump, the character jumps. If he/she moves left or right, so does the character.
The game itself was doing great in test, and the company where I was working decide to create a fit app to calculate steps, burning calories and other datas related to health. And the app would have something very inovative: A fit game to incentivate the user to jump and move as well, and the app register and scores the quality of the movement.
So starts my challenge: How could I create a service to run in background to track the wipace inputs, calculate if its a proper movement so I can score accordly to que movement precision.
Back them I read some papers about the Pokéwalker being very precise, and how it estimate some steps based on constants and stable movements.
So what I did was start creating a equation that calculate stability of the movement, for how long this movement keeps constant and estimate how many steps that would represents for the player.
As a step counter it helps me identify if the player is walking forward, going up in some stairs or just shaking the device imaging it would count as movement. As pokéwalker does and I tried to replicate, I check for how long the player is moving the device, and once the movement is stable and constant, I add some steps based on a average amount of steps and keep counting normally until some variable changes from the constant input, surpassing a calculate threshold also based on some average values.
If the movement surpass my thresholds, it means that something went different than expected and this movement is treated as "wrong" and not computed.
Naturally, I check a numerous amount of variables to determine if the movement was wrong or just "too weak" or "too strong".
Imagine if the player need to move left, and instead of moving left he just shake the device and let's say it was with a proper amount of force to keep inside the threshold. The native service receive the movement input, it was inside the threshold of force but the axys-X did not change.
Once I send it to the game, the game was expecting a variation in X that didn't happened, so the game return a "WRONG" as feedback for the player.
Later, we update the app to receive some physical informations from the users as weight, size and other useful information to help me get even more precise with the calculations.
I'm a huge fan of dinosaur, and when I use to study fossils, I saw a equation to help paleontologists identify speed, size and type of movement a dinosaur was performing when trackways are found.
This equation was proposed by J.W. Alexander in 1928 and consider the size of the dino's foot, the size of the stride between to step marks, and a estimated height based on the foot's size.
v ~= 0.25 x g^0.5 x SL^1.67 x h^-1.17
where g is the gravitational constant, SL is the stride lenght and h is the dinosaur hip's height calculated by estimating the foot size multiplied by 4.
For those interest in read more about this calculation,
https://rainbow.ldeo.columbia.edu/courses/v1001/tracklab.html
In my case I was able to tell the player size since he input it by himself, and the stride lenght I calculate my the small variations in the device input, considering the variation as movements executed by the user, then I just use the V = d/t equation knowing the time between variations and velocity by the Alexander's equation.
This way I'm able to tell with some layer of precision which movement is a "step" and which one is not.
I wish I could tell to who read this I still have the code base for this project, but it was for a particular contractor and I've signed a contract, however as you could see I'm totally able to reproduce my code with much more quality and eficiency since all this happened 10 years ago.
Actually I'm very much inclined to create my own pedometer device now that I also possess eletronic skills as well.
If I have any news regard this project, I come back to update this article.
Top comments (0)