0

I have a pendulum and an IMU sensor that is capable to give me Euler angles and Quaternions. I want to attach the sensor on pendulum and measure θ angle around x axis from the starting position (see the following image). The problem is that the pendulum rotates itself (around z axis) and this is a problem according to Euler singularities (gimbal lock). So when the pendulum is at 180 degrees and rotates around z-axis i get wrong θ angle.

How can i solve this issue and get the correct θ angle?

example of pendulum and sensor

Edit:

Lets say that we attach the sensor on pendulum such as x-axis is parallel to ceiling and z-axis parallel to pendulum's thread.

Cordinate system of the sensor

  • Can you define the coordinte system (XYZ) on the pendulum image? Please provide the code that you implemented. – QuestionMark Nov 08 '19 at 12:13
  • The problem is more a math abstraction, rather than a programming concept. If the sensor doesn't spin around itself (z'axis) i can get θ angle without any problem. In contrast if you spin the pendulum while you are trying to capture θ angle (x'axis) you will have problem. And the problem arise from the fact that euler angles have issue with the gimbal lock. If i had to represent the orientation in 3D graphics i would choose quaternions (wich can solve gimbal locks issues) but in my case i also need to tell the user the angle around a specific axis. – kostilatos90 Nov 08 '19 at 13:50
  • I think the confusion is coming from the way that you're defining the coordinate systems. Please, note that there is a difference between`sensor frame` and `World Frame` that you're defining. Although there is discontinuity in Eeuler representation, but you can still get the angles. I suggest to do the orientation tracking in quaternion representation and then convert the indexes that you need to the Euler representation. – QuestionMark Nov 08 '19 at 14:01

0 Answers0