开发者

Remaping reference coordinate of sensors using custom values

开发者 https://www.devze.com 2023-02-09 13:08 出处:网络
I\'m trying to make motion controller using the values from android sensors. Currently sending/receiving data to/from PC is almost done, and also already gone a trial to rotate cube using orientation

I'm trying to make motion controller using the values from android sensors. Currently sending/receiving data to/from PC is almost done, and also already gone a trial to rotate cube using orientation sensor values, and it seemed usable.

The problem is, as orientation sensor uses magnetic sensor to calculate orientation, the actual values islikely to different from the desired values. For instance, one will expect the cube stays unrotated when he or she directs the controller straight to the PC monitor. Actually, cube will be rotated for such as (27, 59, 107), unless the PC is strictly placed on the north poll.

I've already searched for some references, but only I could found was remapping开发者_Python百科 the reference by predefined constants, such as ROTATE_X_90.

Is there any way to remap reference coordinate by custom values?


  1. Before statrting your motion sensing mode, enter a callibration mode.

  2. Have the user, hold the device in the "default" according your requirement.

  3. Have the user press a "callibrate" button.

  4. Monitor the orientation-sensor values at this instant.
    (Save them as reference).

  5. Now enter normal operation mode. While running you motion-sensor app,
    always subtarct the x,y,z values obtained in "default" position
    from the data obtained using the orientation-sensor.

This way you can have any amount of custom-offsets as reqd.

Good LUCK!!

Regards
CVS@2600Hertz


Create your desired calibration values, then add/subtract this value to/from the read values from the sensor.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号