0

I'm developing a PWA using Capacitor.js, that calculates the rate of rising/falling of the device in meters per second.

I'm using Capacitor's Motion plugin, but I'm unsure how to perform the calculations to convert the devices coordinate system to the global (?) coordinate system so that I get a correct value for rising/falling regardless of the devices orientation.

Here's the information I'm seeking:

  1. Are there any algorithms or formulas I should use to calculate the rate of rising/falling accurately?
  2. How can I process the gyroscope and accelerometer data to detect the device's motion along the global vertical axis?

I would greatly appreciate any insights, algorithms, or code snippets that can help me accurately determine the rising or falling motion of the device, independent of its orientation. Thank you!

device coordinate system global coordinate system

Mez
  • 61
  • 4
  • What units are you looking for in the output "rate of rising/falling"? For example, is this an acceleration? And what are the general time intervals for the problem? For example, does the rising/falling detection need to happen over 10 milliseconds or 10 seconds? Lastly, does this need to happen in real-time? – imuengine.io Jun 20 '23 at 04:15
  • The prefered unit is meters/second and a 1 second time interval should be adequate for my use case. Yes this should happen in real time. – Mez Jun 21 '23 at 06:02

0 Answers0