On Fri, Jan 9, 2009 at 5:31 AM, Sean McNeil <[email protected]> wrote: > > What you are trying to do cannot be done. Accelerometers give you a > vector to GC whereas the G1 has a compass which gives you yaw/pitch/roll > to north.
It is not too difficult to calculate yaw/pitch/roll from the geomagnetic vector and acceleration vector. You can find all the math in cupcake's SensorManger, see getRotationMatrix() and getOrientation(). Of course, with a device that only has an accelerometer, you cannot calculate "yaw", but only pitch and roll. Mathias > > 伊泽 wrote: >> hi pramod gurav, >> >> I think we have the same problem,the lis302/lis331 sensor cannot provide >> yaw/pitch/roll data while we feel hard to emulate G1's compass feature. >> >> But I thought there would be some method to emulate that,,,we get the >> x/y/z >> and change them to yaw/pitch/roll through a model... >> >> hmm,,that's not easy,i think. >> >> thanks >> --wxc200 >> >> >> >> ============ >> 自由之精神,独立之人格 >> ============ >> Zsa Zsa Gabor - "I'm a great housekeeper. I get divorced. I keep the >> house." >> >> On Fri, Jan 9, 2009 at 6:59 PM, pramod gurav <[email protected] >> <mailto:[email protected]>> wrote: >> >> On Fri, Jan 9, 2009 at 3:27 PM, 伊泽 <[email protected] >> <mailto:[email protected]>> wrote: >> > hi >> > >> > why not port your driver to android? >> > That would not be too hard. G1 has a compass and >> > gravity accelerometer sensor,it can detect pitch/roll/rotation >> and motion. >> > Also Iphone ,Borqs and Openmoko has the LIS3XX chip as their sensor. >> > this is openmoko's: Accelerometer data retrieval >> > But lis3xx sensor is a gravity accelerometer sensor,it has >> > not function as G1's compass,when you put phone on the flat >> table ,it cannot >> > detect rotation. >> > >> > Ofcourse,you should choose your sensor depend on the app design. >> > >> > thanks >> > --wxc200 >> > >> > >> Hi I have ported the drivers according to android. >> The sensors on my h/w are ak8973(magnetic x,y,z) and lis302dl(acc >> x,y,z). >> They do not give the yaw, pitch roll. >> I could get the values on my android application. >> But cant get the yaw, pitch and roll. I was expecting that Android can >> calibrate >> these values as my h/w have no support. >> >> >> >> > ============ >> > 自由之精神,独立之人格 >> > ============ >> > Joan Crawford - "I, Joan Crawford, I believe in the dollar. >> Everything I >> > earn, I spend." >> > >> > On Fri, Jan 9, 2009 at 3:26 PM, Mathias Agopian >> <[email protected] <mailto:[email protected]>> >> > wrote: >> >> >> >> Hi, >> >> >> >> Android doesn't "require" yaw / pitch / roll per se. In theory, >> well >> >> written applications should check for the presence of these >> sensors. >> >> Unfortunately, in Android 1.0 there wasn't an easy way to >> integrate a >> >> new sensor h/w. >> >> >> >> I think it is more sane to target the "cupcake" release of Android, >> >> which a work in progress is available in the main git repository. >> >> >> >> Future (cupcake) applications will be able to use the SensorManager >> >> to calculate the yaw / pitch / roll from the acceleration and >> magnetic >> >> data (this is actually more precise than the data coming out of the >> >> driver!). Additionnaly, there is a HAL module to implement your >> sensor >> >> h/w which describes precisely what is expected from the higher >> layers >> >> (see sensors.h). >> >> >> >> A sensor h/w can expose yaw/pitch/roll if it wants to, but is not >> >> technically required; the framework will expose a "fake" >> >> yaw/pitch/roll sensors if one is not published by the sensor >> HAL and >> >> if Acceleration and Magnetic data are available. >> >> >> >> Note that the definition of the axis at the h/w level have changed >> >> between 1.0 and cupcake, so be sure to read carefully the >> >> documentation in sensors.h. >> >> >> >> >> >> Android doesn't do ANY calibration on its own. The drivers >> and/or HAL >> >> modules are expected to do this. >> >> >> >> >> >> In "theory", all you need to do is implement a sensor HAL module >> >> properly (as documented in sensors.h. pay extreme attention to the >> >> definition of the axis and units). Unfortunately, in the >> current git >> >> repository there are no sample code of a sensor HAL module, which >> >> makes this task more difficult; however we will fix this >> problem soon >> >> by including the G1 HAL module source code, stay tuned. >> >> >> >> I hope this helps. >> >> >> >> Mathias >> >> >> >> >> >> On Thu, Jan 8, 2009 at 9:45 PM, pramod gurav >> <[email protected] <mailto:[email protected]>> >> >> wrote: >> >> > >> >> > Hi All, >> >> > I am trying to integrate my compass and accelerometer sensors >> into >> >> > android. >> >> > These are two different sensors which support only providing >> magnetic >> >> > x, y, z and >> >> > acceleration in x, y and z direction. As I gone through the >> HAL layer >> >> > of android I >> >> > could know that android expects yaw, pitch, row also from the >> under >> >> > lying driver. >> >> > I just wanted to conform this as the sensors we are using >> does not >> >> > give any values >> >> > other than above mentioned. >> >> > I would also like to know whether android does any >> calibration on its >> >> > own to get these >> >> > values in case these are not supported by hardware. >> >> > Please let me know if I need to provide more details regarding my >> >> > sensors. >> >> > >> >> > >> >> > -- >> >> > Best Regards >> >> > Pramod >> >> > >> >> > > >> >> > >> >> >> >> >> > >> > >> > > >> > >> >> >> >> -- >> Best Regards >> Pramod >> >> >> >> >> > > > > > > --~--~---------~--~----~------------~-------~--~----~ unsubscribe: [email protected] website: http://groups.google.com/group/android-porting -~----------~----~----~----~------~----~------~--~---
