").appendTo(b);c.set("href","#");c.addClass("iconthumbsdown")});a.all(".xdkabtn").each(function(){this.on("click",function(c){c.halt();var b=document.createElement("form");b.setAttribute("method","POST");b.setAttribute("action",this.getAttribute("href"));document.body.appendChild(b);b.submit();return false})})});
Christian Rank: Youngling  Hello Community, i started my first project off with a friend here: https://xdk.boschconnectivity.com/community//message_boards/message/320751 So that Franjo said it would be nice to make a new thread we are here now. :) It took approx. 2 weeks now to inform me about the orientation data (quarternions) and their calculation. Despite the fact that i found a few dissertations about this i could not get any calculation to work. So i ask you guys to help me. We want to calculate the orientation data with the accelerometer to an x,y,z coordination system (x,y would work also). At the beginning we need to set a zero reference point. Did anyone face this problem already and would provide us any code examples or something? How to calculate this would also help very much. I know thats much to ask for but I am not getting forward and we are running out of time.
Thank you very much in advance.

0 (0 Votes) 
Franjo Stjepandic Rank: Yoda  Hello Christian, S(t) = s0 + v(t)*t + 0.5*a(t)*t^2All coefficients of this equation should be regarded as vectors (since we are talking about a 3dimensional space), only time (t) is onedimensional here. To calculate velocity and distance, you can measure the time between two samples of the quaternion values and integrate them twice. Here, I recommend looking up on numerical integration techniques to minimize the integration error. Additionally, you would need to set an origin point from where the movement distance can be calculated. This could be solved by hardcoding it as current position during initialization, or when pressing a button. Furthermore, it is helpful to use sensor fusion algorithms to combine the orientation data with the data of an additional accelerometer or gyroscope to receive more precise acceleration data for further calculation. For that, I recommend, putting some research into sensor fusion algorithms. Overall, please do not regard this information as a solution  mapping the XDK in 3D space with only orientation and accelerometer data is very difficult to do, and as such, I can only give you pointers. Please let me know if that was helpful and feel free to ask if you have further questions. Kind regards, Franjo

0 (0 Votes) 