Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

getting yaw-pitch-roll data from the hardware
Started by vpivnenko Jul 31 2014 11:22 AM

3 replies to this topic
yaw pitch roll gyro gyroscope accelerometer device rotation device position
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

vpivnenko

[GLOBAL: userInfoPane.html]
vpivnenko
  • Observer

  • 2 posts
  • Corona SDK

How to get yaw-pitch-roll values from the device using Corona SDK (not a custom code written in Obj-C/Java)?

On iOS this data can be reached by

CMMotionManager.deviceMotion.attitude.yaw

CMMotionManager.deviceMotion.attitude.pitch

CMMotionManager.deviceMotion.attitude.roll

 

So far, in CoronaSDK, I see only one way: to cumulate xRotation, yRotation and zRotation values of gyroscope in a runtime. But I didn't test it yet.

Please assist.

 

 



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,253 posts
  • Enterprise

I don't believe we provide yaw, pitch and roll using those terms.  I believe that is what xRotation, yRotation and zRotation provide those values.

 

Rob



[TOPIC: post.html]
#3

vpivnenko

[GLOBAL: userInfoPane.html]
vpivnenko
  • Observer

  • 2 posts
  • Corona SDK

I tried to cumulate xRotation, yRotation and zRotation values received from the gyroscope in CoronaSDK but it didn't help.

When I run an app the initial values are 0, 0 and 0. Then I turn device to some direction little bit and values are changing properly, then I turn the device back to initial position and I can see how cumulate values return to zero which is nice. However, if I rotate device more (like 3-4 full turns to same direction and then back) values are significantly off of zero.

In this approach I see 2 problems:

1) the value doesn't return to 0 as I expect;

2) the initial value is 0,0,0 and I cannot determine the device's position in space according to the ground.

On iOS that can be easily reached by calling 

CMMotionManager.deviceMotion.attitude.yaw

CMMotionManager.deviceMotion.attitude.pitch

CMMotionManager.deviceMotion.attitude.roll

 

Are you planning to improve the gyroscope in CoronaSDK?



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,253 posts
  • Enterprise

I'm unaware of any plans to add extra features.  You could put in a feature request at:

 

http://feedback.coronalabs.com

 

Rob




[topic_controls]
[/topic_controls]