tag:blogger.com,1999:blog-8561422555282976331.post7175817776849915659..comments2011-03-02T08:38:08.564-06:00Comments on Mystic Lake Software: Sensor - Accelerometer & MagneticsRud Merriamhttp://www.blogger.com/profile/05243211372637967124noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-8561422555282976331.post-27681871773270742912011-03-02T07:56:04.609-06:002011-03-02T07:56:04.609-06:00Thanks, Rud, that's what I supposed. Thanks al...Thanks, Rud, that's what I supposed. Thanks also for correcting the typo ;) Deviation of course. All in all this matches with the behavior of the iOS. There you also have to enable location services in order to obtain "true" heading instead of magnetic heading.<br />Kind regardsAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-76773178602319267872011-03-01T15:05:24.064-06:002011-03-01T15:05:24.064-06:00@neil,
I think you would need to add in the magne...@neil,<br /><br />I think you would need to add in the magnetic deviation. <br /><br />I would suggest that this is a correction that should be applied outside of this class for good OO.Rud Merriamhttps://www.blogger.com/profile/05243211372637967124noreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-82643598784563366822011-03-01T14:07:09.706-06:002011-03-01T14:07:09.706-06:00Rather old thread, but allow me a question, please...Rather old thread, but allow me a question, please. Doesn't the obtained bearing need to be corrected by the magnetic derivation value obtained by GeoField.getDeclination() before being used as "true" heading? Otherwise the heading is always relative to the magnetic north, isn't it?<br />RegardsAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-3955374356400697492010-06-01T10:44:26.622-05:002010-06-01T10:44:26.622-05:00@Markus - thanks for the citation in your discussi...@Markus - thanks for the citation in your discussion. I'll read through it carefully soon.<br /><br />@darkflame - Sorry for the delay in releasing your post. <br /><br />One general point is that I pulled the averaging from the routines. First it was confusing things and second, it really isn't good OO to have it in the measrurement class. Any averaging / filtering should be done with the values the class generates. <br /><br />What are the values - I don't remember and don't have time at the moment to look at the code. Sorry. My best memory is that they are radians.Rud Merriamhttps://www.blogger.com/profile/05243211372637967124noreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-66982614708831405972010-06-01T10:17:08.674-05:002010-06-01T10:17:08.674-05:00Rud, thanks for explaining orientation sensing!
I...Rud, thanks for explaining orientation sensing!<br /><br />I have done some further work based on your code. If you or others find it interesting, you can find the report here: http://photosaround.mandreasson.com/2010/05/technical-orientation-sensing-in-photos.htmlMarkus Andreassonhttps://www.blogger.com/profile/02236012822378720716noreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-6824855717160429252010-05-24T10:06:36.787-05:002010-05-24T10:06:36.787-05:00This code is very helpfull, but I must admit I'...This code is very helpfull, but I must admit I'm lost in the basic's.<br />I'm trying to hock this upto a OpenGL camera for Augmented Reality (using http://www.jpct.net - which is a really nice 3D engine).<br /><br />My questions are basically;<br /><br />The averaged v[x] values, what are they? degree's? what range?<br />Which one is roll,pitch and yaw?<br /><br />Ive tried to work this out by blitting them to the screen, but I'm getting much confusion because no mater how carefull I rotate the phone in one axis *all* the values change by quite a lot :(Unknownhttps://www.blogger.com/profile/11995986193895023836noreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-27498022082521067752009-12-29T21:41:02.359-06:002009-12-29T21:41:02.359-06:00btw, thanks a lot for the quick answer =)btw, thanks a lot for the quick answer =)Oropherhttps://www.blogger.com/profile/18317159209012394407noreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-76693882078593482162009-12-29T21:35:52.640-06:002009-12-29T21:35:52.640-06:00Another question, the values returned by the combi...Another question, the values returned by the combined sensors is in the same scale of the orientation sensor?, i did put the both values in the screen but these are not the same, there are too much variation, i think that this is probably because the sensor is not very well calibrated, but i´m not sure. i have to do more tests =POropherhttps://www.blogger.com/profile/18317159209012394407noreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-12349956167005402762009-12-29T11:51:35.604-06:002009-12-29T11:51:35.604-06:00@Oropher
First, the combined sensors are supposed...@Oropher<br /><br />First, the combined sensors are supposed to be more accurate according to the documentation. Second, the combination sensors allow you to change the coordinate system with respect to the phone. I wanted the landscape coordinate system for my game with the compass bearing through the screen and out the back of the phone. <br /><br />I have a test program that puts both the orietnation and the combined sensor derieved orientation on the display at the same time. The value are comparable. So unless you want to change the coordinate system the orientation sensor seems sufficient. <br /><br />I have a G1 and the magnetic sensor is not completely stable but it is usable.Rud Merriamhttps://www.blogger.com/profile/05243211372637967124noreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-40235529869637938202009-12-29T11:39:02.595-06:002009-12-29T11:39:02.595-06:00Hello, I just test your code and have some questio...Hello, I just test your code and have some questions, what is the difference between the data obtained by the orientation sensor and the combination of magnetic sensor and accelerometer?, My question is as follows, what I wanted was to get the address to which you will find the phone (btw I am using a motorola Dext) with the orientation that I get the values for the variable degrees of azimuth, but seeing the magnetic sensor values vary widely but the phone is not moving .<br /><br />The worst excuse my English translation is not very good jejeOropherhttps://www.blogger.com/profile/18317159209012394407noreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-656988858170883362009-09-29T13:01:20.430-05:002009-09-29T13:01:20.430-05:00No problem. By the way, do you understand why rota...No problem. By the way, do you understand why rotating slowly from portrait to landscape affects all three angles returned by a Sensor.TYPE_ORIENTATION event, and not only the roll angle (orients[2])?Olivierhttps://www.blogger.com/profile/05555880921717923530noreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-82742486959831736092009-09-28T16:35:18.798-05:002009-09-28T16:35:18.798-05:00@Olivier - Thanks for the tip. I will try that. In...@Olivier - Thanks for the tip. I will try that. In landscape mode the compass direction _is_ twitchy when pointing south. I've done some looking into why but didn't consider the averaging as a source of the problem.Rud Merriamhttps://www.blogger.com/profile/05243211372637967124noreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-29676481926464293762009-09-28T14:48:14.268-05:002009-09-28T14:48:14.268-05:00Using a similar filter, I get bogus average values...Using a similar filter, I get bogus average values when the sensor orientation jumps from 180 to -180, which is actually the same angle.<br /><br />A proper way to average angles is:<br /><br />avg_in_radians = Math.atan2(sumY, sumX);<br /><br />where sumY is the sum of the sines, and sumX the sum of cosines.Olivierhttps://www.blogger.com/profile/05555880921717923530noreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-43170603322042840962009-09-03T04:40:21.172-05:002009-09-03T04:40:21.172-05:00I added the digital filter class to the entry.I added the digital filter class to the entry.Rud Merriamhttps://www.blogger.com/profile/05243211372637967124noreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-33284557279662879892009-09-02T18:34:07.575-05:002009-09-02T18:34:07.575-05:00Hi! Thanks for the posts, they are very helpful! C...Hi! Thanks for the posts, they are very helpful! Could you please share the implementation details of that digital filter class?Macadamiahttps://www.blogger.com/profile/13926680026645155374noreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-43968164011625574072009-08-14T21:51:28.782-05:002009-08-14T21:51:28.782-05:00The digital filter just takes an average of the la...The digital filter just takes an average of the last set of readings. I am using 4 reading presently but that is just a wild guess at how many to use. The tradeoff is that to few reading results in poor smoothing while to many makes the response to a move to sluggish.Rud Merriamhttps://www.blogger.com/profile/05243211372637967124noreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-19395356171253334312009-08-14T14:40:00.921-05:002009-08-14T14:40:00.921-05:00Could you please explain what the DigitalFilter cl...Could you please explain what the DigitalFilter class is please.<br /><br />I have omitted this last section where you use filter[0].average etc<br /><br />and all I get back is zero values.<br /><br />Thanks!Unknownhttps://www.blogger.com/profile/15092460910085295160noreply@blogger.comtag:blogger.com,1999:blog-8561422555282976331.post-67958779770295463832009-08-03T16:00:41.771-05:002009-08-03T16:00:41.771-05:00Hi, I've been working on this for a wile and I...Hi, I've been working on this for a wile and I have it working, but my readings are really the opposite to SMOOTH.<br /><br />I supose it's due to the DigitalFilter class used in the example but I'm not sure..<br /><br />Can you please share that class in order to test the full example?<br /><br />Thanks in advance<br /><br />DaviddavidNethttps://www.blogger.com/profile/14002213587969456711noreply@blogger.com