If I use euler angles, I'm aware of them having different ways to represent the same rotation but, at the same time, I need to be able to check the rotation progress in X axis. It starts, for instance, at rotation 15 degrees in X axis and I don't care about Y and Z. If I look at it after some movements of that object, maybe it shows that X axis is different although maybe X axis didn't move at all, this is because of euler angles. With quaternions this is not supposed to happen but I don't know how to check then, the progress in the rotation of one axis.
Related
I have a straight trendline on a semi-log chart (ie y axis in log scale, and x axis (ie time) in regular scale).
I think therefore the equation of that straight line is y = a * b^x
I want to move the line up or down though according to trigonometry but don't know if I can as the opposite side of the triangle is in log scale. I can do this fine on regular scale charts, but I dont know where to begin for semilog charts.
Anyone know how I do this or if there's an equation I can use to calculate how much i move the line up or down?
I am trying to represent the orientation of a rigid body, say a pencil in 3 dimensional space with respect to fixed XYZ axes, originating at a fixed origin O. I am trying to visualize arriving at the quaternion representing the orientation of the pencil, by thinking in terms of the axis vector of the pencil's current orientation(i.e axis), and the roll on its own central lengthwise axis, (Following equation for quaternion from axis-angle representation is from Wikipedia).
Now as per my understanding if the roll of the pencil is zero, then the vector part of the quaternion vanishes, since sin(theta/2) shall become zero, and the resulting quaternion no longer has information of horizontal and vertical tilt with respect to the fixed axes. How I can describe the orientation of the pencil using quaternions in cases where the roll of the pencil is zero.
It is clearer if we imagine that the quaternion specifies the rotation from the default orientation of the pencil to its present orientation. One way of specifying this would be to assume that default orientation of the pencil is along the extrinsic X axis, with the default roll being zero when the label face is on the top. Now one possible way to describe the present orientation of the pencil is by the following three rotations:
Rotation about the Z, axis by the yaw angle
Rotation about the new Y axis, by the pitch angle
Rotation about the new X axis, by the roll
The combination of these three rotations, obtained by their quaternion product , will give us the quaternion of the pencil's present orientation, even if the roll, pitch or yaw is zero.
I have a chart that has several existing curves on it that I have tried to interpolate new curves in between. I have used linear interpolation in the form of y = ((x - x1)(y2 - y1) / (x2 - x1)) + y1, however the new curves look out of place.
You can see in the picture that every second line (from the bottom) is the interpolated line. While the very second line data points are exactly centered between the first and third data points in the y axis, the third line data points are not centered between the second and fourth y data points, making the graph look skew.
So I am thinking linear interpolation may not be what I am after here. Can someone recommend another method that would create curves between the existing ones, but replicates the same form?
Sudden changes in gradient are hard to interpolate. When you're at the point where you want an interpolated line to suddenly change gradient, there is no information from the points in close proximity that give information as to where the sudden change in gradient should occur.
To replicate the pattern, you actually need to copy the gradient of the line below then smoothly transition to the gradient of the line above. Visually we can see that it should occur half way between the change in gradients for the lines above and below on either side, but detecting the locations of those changes is not trivial.
The points where the sudden change in gradient are occurring are separated by a large change in the x-axis by only a small change in the y-axis. When calculating y-values for x-values in between the the changes in gradient you get the aberrations. I suggest trying to interpolate x-values based on y-values instead. For each curve, for each small arbitrary step in the y-axis, find/calculate the closest x-values from the curve on either side and take the average to plot your interpolation.
An unconventional approach may be a piece-meal style of interpolation. It may be possible to model the 3 regions of different gradients separately.
Start by identifying the 2 lines that would be drawn through the 2 sets of kinks, creating 3 regions of space. The vertical line would stop at the horizontal line near the bottom right corner of the graph.
For each region (and potentially for each value of x in each region) determine the gradient of the lines. When you're doing your interpolation of a new line, for each starting point (x1, y1), look at which region it falls in. Use the gradient of that region as a significant factor when determining the next point. Keep doing this until you reach a region boundary. When the interpolated point crosses into a different region, then use the gradient of that region as a significant factor to interpolate the next point.
It will be quite pointy if you did this strictly, so graph with some smoothing (or incorporate a smoothing factor using weighted averages of the gradients as you transition between regions, but this could be a whole lot of effort without necessarily closer results!)
So I searched on the net and I'm having some problems imagining how the
gimbal-lock occurs. According to what i saw, it occurs when 2 or more axes align losing a degree of freedom but I can't imagine how will the axes even begin to align?
I mean, when i rotate an object around x-axis (for example) doesn't the y and z axes rotate with the X-axis to remain perpendicular? How are they gonna align? Similarly whenever i rotate around Y or Z axis the other 2 axis rotate together and remain perpendicular don't they?
To get a more clear view what I am having problem imagining, check this video.
At 5:05
https://youtu.be/Mm8tzzfy1Uw?t=305
You'll see when he rotates around the X axis the green and the blue rings remain there where as according to my imagination the green (Y) and blue (Z) axes should have rotated. I don't understand why the rings are still aligned with the world axis?
Gimbal Lock.
Gimbal lock does not lock an axis but rather it locks the action of the gyro to move freely in all three axis.
The gimbal's three axis, yaw outer ring (axis along up/down), pitch next ring in (axis along left/right), and roll the inner ring (axis along front/back). If you rotate the pitch ring 90 deg in either direction it will align the roll axis with the yaw axis and the gyro will act as if they are one.
The following image will help
Left. The Gimbal at start, red axis yaw, blue pitch, green roll. Then rotating around pitch 90deg (blue axis),the roll axis (green) is aligned with the yaw axis (red) and you have gimbal lock.
I'm working on the Wii Motionplus and I've extracted the raw values using WiimoteLib Library. However, when I normalize it, I get random values that don't tally with what is actually happening.
This is how I'm normalizing:
Calibrate the Motionplus (i.e. Find the raw value that corresponds to zero; I do this by holding it stationary for a point of time)
For every subsequent raw value read, I subtract the zero value from it to get the "relative" raw value.
Then, I scale this value using http://wiibrew.org/wiki/Wiimote/Extension_Controllers (checking for yaw_fast, pitch_fast etc.), where the numerical values are computed using the measure (raw value of 8192 corresponds to 595 deg/s)
I sum up all these values over time (discrete integration) to get the angle of the wiimote wrt initial orientation.
However, when I calculate this and plot it out on a graph, a step change in one of the axes is NOT being reflected in the graph. I tried using a digital compass with it to compare, but while the compass reflects the values correctly, the wii values are completely different (even the pattern is not the same)
Can anyone tell me where I'm going wrong with the normalization?
Thanks!
The numbers that are being sent out are rotations about the x y and z axis respective to itself. In order to relate this to x,y,z coordinates you will need to use a rotation matrix, and since the rotation readings are not a fixed axis but depend on what orientation you are at you need to use a Euler Matrix to relate this to a fixed x,y,z coordinate
In other words you are receiving roll, yaw and pitch velocities and you need to use a Euler Matrix to relate this to cartessian coordinates. Once you know your initial roll, pitch and yaw you can simply add your next reading of roll, pitch and yaw to that initial times the time interval that that reading applies to.
ROLL is Rotation about the y-axis
PITCH is Rotation about the x-axis
YAW is Rotation about the z-axis