Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!

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

voolla mohan
Greenhorn
Posts: 2
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.
http://developer.android.com/reference/android/hardware/SensorEvent.html#values

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.

step-1;-
---------
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)

step-2:-
----------
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

sleep(10000);

// 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.

//

if(driving_mode_detected)
{
boolean x = detect_Impact();
if(x==TRUE)
{
send_message();
}
}

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,

Regards