7

I've been doing a bit of research on a problem we are trying to solve. I think this is the best approach but please add in your opinions

We are trying to calculate reaction times in a real world driving scenario and would like to use a mobile phone as the data collection device. What we are trying to accomplish is how much acceleration and more importantly deceleration a driver exerts when exposed to certain prompts.

I found this paper that has allot of useful information Accelerometer physics

The problem is that we most likely will not have a calibration time to start at zero.. however it is assumed that the driver is starting at 0. We will use GPS positioning to locate the vehicle, tracking the time stamped location data we should calculate the time when the prompt took place then using the time stamped accelerometer data we should be able to calculate their reaction to the prompt.

This is the best way I have found to solve the problem however I'm not sure if the accelerometer data will be rendered useless because of not being able to calibrate it and also the noise seen from vibrations may be too great to use the data... Has anyone tried or used these types of methods before?

Ali
  • 56,466
  • 29
  • 168
  • 265
Monergy
  • 939
  • 3
  • 13
  • 24
  • 1
    You only write acceleration and decelration in your post. Why do you need the velocity? What for? – Ali Jun 06 '12 at 21:01
  • possible duplicate of [Android accelerometer accuracy (Inertial navigation)](http://stackoverflow.com/questions/7829097/android-accelerometer-accuracy-inertial-navigation) – Hans Passant Jun 06 '12 at 21:09
  • The velocity is important to determine the before and after response to the prompt.. I'm expecting the GPS to give a relatively accurate result but if we can calculate a better more accurate model that would be preferred – Monergy Jun 06 '12 at 22:42
  • @Monergy I would give up on the velocity. With the current sensors you won't get anything accurate. I would try the GPS instead. – Ali Jun 07 '12 at 09:28
  • @Ali When people ask for something, don't start by asking what for. It's a fair assumption that they already know. – A.Grandt Dec 17 '14 at 13:56
  • @A.Grandt He asks for velocity in the **title** but only talks about acceleration and deceleration in the **body** of the question, without mentioning velocity *ever*. At this point, it seems quite natural to me to ask why the velocity is in title but not in the body of the question. As for the rest of your comment: In my opinion, it is usually a good idea to tell the others about the bigger picture so that you don't fall into the [XY problem](http://meta.stackexchange.com/q/66377/157577). – Ali Dec 17 '14 at 14:36
  • @ali My bad. Apologies. – A.Grandt Dec 17 '14 at 15:12
  • 1
    @A.Grandt No problem. By the way, it also irritated me when people kept asking "Why do you need it?" or kept questioning the usefulness of my application, when I asked a question. So I understand your initial reaction, no problem. – Ali Dec 17 '14 at 15:48

2 Answers2

4

Interesting application.

You are missing an important point. You either have to implement the so-called sensor fusion yourself or use the sensor fusion provided on the platform you are using. Both Android and iPhone have one.

The TYPE_LINEAR_ACCELERATION (Android, SensorManager) or userAcceleration (iPhone) should be sufficient for you.

As for the linked PDF, don't try integrating the acceleration, you will get very poor results. Even though that answer is about position, the velocity will already be inaccurate. I would try the GPS instead.

Community
  • 1
  • 1
Ali
  • 56,466
  • 29
  • 168
  • 265
  • Many thanks! I see that the Android API only works for version 10 and newer.. so thats only about a year and a half old.. the sensor fusion can be done manually in earlier versions no? – Monergy Jun 06 '12 at 22:23
  • You can achieve it as long as you have an accelerometer and a magnetic field sensor. You unfortunately usually don't get any better result doing it yourself though. On that particular case I don't believe that calibration will be your first matter, as noise and accuracy will. GPS will help you badly for this I believe ^^ – PeterGriffin Jun 07 '12 at 08:15
  • @Monergy Yes, you can do the [sensor fusion](http://stackoverflow.com/a/5895189/341970) yourself. It is a non-trivial and very time consuming task, I implemented it on the Shimmer platform. – Ali Jun 07 '12 at 09:34
0

I know it's very old question but since I am recently working on a similar project let me share what we did in our company. We simply used OBD-II dongle to get velocity of car. There are many API's that return information about vehicle.

PID010D returns speed of vehicle. I'm using this PID to calculate distance between points A and B since there is no PID to return Odometer :(

There are few libraries on github that you can find easily by search. This mine. This is not library but after run on your device you can see how it works.

Hesam
  • 52,260
  • 74
  • 224
  • 365