• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
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
 
Roses are red, violets are blue. Some poems rhyme and some don't. And some poems are a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic