This week's book giveaways are in the AI and JavaScript forums.
We're giving away four copies each of GANs in Action and WebAssembly in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Joe Ess
  • salvin francis
  • fred rosenberger

how to calculate the values of alpha , beta ,gamma values.

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Application automatically detects the driving mode and allows you to contact for up to three phone numbers of emergency in case of accident.

The three numbers will be contacted by sending a text message as ( custom emergency message) with the geographical coordinates of the accident site.

I have divided this project in to three phases ,

i) Detection of driving Mode:-(Intent Service)
I'm using Google Activity Recognition API to detect the driving Mode and logic behind it is , if ( DetectedActivityType="IN_VEHICLE" && Confidence > "90") then i will consider it as driving Mode

ii) Detect Accident:-(Service)
In this phase i want to detect impact at the moment of accident with help of accelerometer in a mobile.
Please refer the link below

At the moment when i detect the driving mode , i'll start taking linear_acceleration readings as ( x-axis = Sensor.event[0], y-axis = Sensor.event[1] ,z-axis = Sensor.event[2] ) and i can have the values of gravity as well (x-axis = Sensor.event[0], y-axis = Sensor.event[1] ,z-axis = Sensor.event[2] ) and net gravity is constant, but corresponding x,y,z values of gravity changes as if you tilt the phone in different direction.

Generally, standard gravity value is around = 9.8 m/s2 and its direction is always towards ground.
we have x,y,z values of gravity. so,we can calculate angle between x-axis to standard gravity,similarly we can calculate for y,z axis. say(alpha,beta & gamma)

since, x,y,z axis is fixed to the mobile, so we can calculate linear_acceleration towards ground say (a_g) with help of a (alpha,beta & gamma).

Now, i'll take threshold value as 3g ( i,e 3 * 9.8)

boolean detect_impact()
if(change_in_net_linear_acceleration >= 20 )
if (a_g >3g)

// wait for ten seconds


// checking whether the person is moving or not , if not moving consider he/she is unconscious

if(DetectActivityType=="STILL" && confidence=="90")

return TRUE;

iii) Send Message to concerned people ;-(Service)
At the moment when i detect the impact , I will invoke this service and send text message to the concerned people with geographical coordinates of accident site with the help of GPS.


boolean x = detect_Impact();

I have successfully written code for the 1st and 3rd phase , but in the second phase i'm not able to get (alpha, beta and gamma) values correctly . My Query is whether the logic can be implementable or not , if yes, then please kindly help me out to calculate the values of alpha , beta ,gamma values.

Thank you,

Something must be done about this. Let's start by reading this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!