Horn, Berthold KP. "Closed-form solution of absolute orientation using unit quaternions." JOSA A 4.4 (1987): 629-642.
http://people.csail.mit.edu/bkph/papers/Absolute_Orientation.pdf
See Sim3Solver of ORB-SLAM2 project.
2017년 2월 14일 화요일
2016년 11월 4일 금요일
AxisAngle to Quaternion
qx = ax * sin(angle/2)
qy = ay * sin(angle/2)
qz = az * sin(angle/2)
qw = cos(angle/2)
where:
the axis is normalised so: ax*ax + ay*ay + az*az = 1
the quaternion is also normalised so cos(angle/2)2 + ax*ax * sin(angle/2)2 + ay*ay * sin(angle/2)2+ az*az * sin(angle/2)2 = 1
// assumes axis is already normalised public void set(AxisAngle4d a1) { double s = Math.sin(a1.angle/2); x = a1.x * s; y = a1.y * s; z = a1.z * s; w = Math.cos(a1.angle/2); }
http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/
2014년 7월 9일 수요일
CMAttitudeReferenceFrame
Enum constants for indicating the reference frames from which all attitude samples are referenced.
typedef enum {
CMAttitudeReferenceFrameXArbitraryZVertical = 1 << 0,
CMAttitudeReferenceFrameXArbitraryCorrectedZVertical = 1 << 1,
CMAttitudeReferenceFrameXMagneticNorthZVertical = 1 << 2,
CMAttitudeReferenceFrameXTrueNorthZVertical = 1 << 3
} CMAttitudeReferenceFrame
CMAttitudeReferenceFrameXArbitraryZVertical
: Describes a reference frame in which the Z axis is vertical and the X axis points in an arbitrary direction in the horizontal plane.
CMAttitudeReferenceFrameXArbitraryCorrectedZVertica
: Describes the same reference frame as CMAttitudeReferenceFrameXArbitraryZVertical except that the magnetometer, when available and calibrated, is used to improve long-term yaw accuracy. Using this constant instead of CMAttitudeReferenceFrameXArbitraryZVertical results in increased CPU usage.
CMAttitudeReferenceFrameXMagneticNorthZVertical
: Describes a reference frame in which the Z axis is vertical and the X axis points toward magnetic north. Note that using this reference frame may require device movement to calibrate the magnetometer.
CMAttitudeReferenceFrameXTrueNorthZVertical
: Describes a reference frame in which the Z axis is vertical and the X axis points toward true north. Note that using this reference frame may require device movement to calibrate the magnetometer. It also requires the location to be available in order to calculate the difference between magnetic and true north.
all available in iOS 5.0 and later.
source : Apple dev page.
typedef enum {
CMAttitudeReferenceFrameXArbitraryZVertical = 1 << 0,
CMAttitudeReferenceFrameXArbitraryCorrectedZVertical = 1 << 1,
CMAttitudeReferenceFrameXMagneticNorthZVertical = 1 << 2,
CMAttitudeReferenceFrameXTrueNorthZVertical = 1 << 3
} CMAttitudeReferenceFrame
CMAttitudeReferenceFrameXArbitraryZVertical
: Describes a reference frame in which the Z axis is vertical and the X axis points in an arbitrary direction in the horizontal plane.
CMAttitudeReferenceFrameXArbitraryCorrectedZVertica
: Describes the same reference frame as CMAttitudeReferenceFrameXArbitraryZVertical except that the magnetometer, when available and calibrated, is used to improve long-term yaw accuracy. Using this constant instead of CMAttitudeReferenceFrameXArbitraryZVertical results in increased CPU usage.
CMAttitudeReferenceFrameXMagneticNorthZVertical
: Describes a reference frame in which the Z axis is vertical and the X axis points toward magnetic north. Note that using this reference frame may require device movement to calibrate the magnetometer.
CMAttitudeReferenceFrameXTrueNorthZVertical
: Describes a reference frame in which the Z axis is vertical and the X axis points toward true north. Note that using this reference frame may require device movement to calibrate the magnetometer. It also requires the location to be available in order to calculate the difference between magnetic and true north.
all available in iOS 5.0 and later.
source : Apple dev page.
2013년 12월 12일 목요일
Z-Y-X Euler Angles
Z-Y-X Euler Angles
Z-Y-X Euler Angles (or X-Y-Z fixed angles)
Rx'y'z' (a,b,c) =
[ cos(a)*cos(b), cos(a)*sin(b)*sin(c) - cos(c)*sin(a), sin(a)*sin(c) + cos(a)*cos(c)*sin(b)]
[ cos(b)*sin(a), cos(a)*cos(c) + sin(a)*sin(b)*sin(c), cos(c)*sin(a)*sin(b) - cos(a)*sin(c)]
[ -sin(b), cos(b)*sin(c), cos(b)*cos(c)]
X-Y-Z Euler Angles
Rz'y'x' (a,b,c) =
[ cos(b)*cos(c), -cos(b)*sin(c), sin(b)]
[ cos(a)*sin(c) + cos(c)*sin(a)*sin(b), cos(a)*cos(c) - sin(a)*sin(b)*sin(c), -cos(b)*sin(a)]
[ sin(a)*sin(c) - cos(a)*cos(c)*sin(b), cos(c)*sin(a) + cos(a)*sin(b)*sin(c), cos(a)*cos(b)]
Z-Y-X Euler Angles (or X-Y-Z fixed angles)
Rx'y'z' (a,b,c) =
[ cos(a)*cos(b), cos(a)*sin(b)*sin(c) - cos(c)*sin(a), sin(a)*sin(c) + cos(a)*cos(c)*sin(b)]
[ cos(b)*sin(a), cos(a)*cos(c) + sin(a)*sin(b)*sin(c), cos(c)*sin(a)*sin(b) - cos(a)*sin(c)]
[ -sin(b), cos(b)*sin(c), cos(b)*cos(c)]
X-Y-Z Euler Angles
Rz'y'x' (a,b,c) =
[ cos(b)*cos(c), -cos(b)*sin(c), sin(b)]
[ cos(a)*sin(c) + cos(c)*sin(a)*sin(b), cos(a)*cos(c) - sin(a)*sin(b)*sin(c), -cos(b)*sin(a)]
[ sin(a)*sin(c) - cos(a)*cos(c)*sin(b), cos(c)*sin(a) + cos(a)*sin(b)*sin(c), cos(a)*cos(b)]
Rz'y'x' (c,b,a) =
[ cos(a)*cos(b), -cos(b)*sin(a), sin(b)]
[ cos(c)*sin(a) + cos(a)*sin(b)*sin(c), cos(a)*cos(c) - sin(a)*sin(b)*sin(c), -cos(b)*sin(c)]
[ sin(a)*sin(c) - cos(a)*cos(c)*sin(b), cos(a)*sin(c) + cos(c)*sin(a)*sin(b), cos(b)*cos(c)]
[ cos(a)*cos(b), -cos(b)*sin(a), sin(b)]
[ cos(c)*sin(a) + cos(a)*sin(b)*sin(c), cos(a)*cos(c) - sin(a)*sin(b)*sin(c), -cos(b)*sin(c)]
[ sin(a)*sin(c) - cos(a)*cos(c)*sin(b), cos(a)*sin(c) + cos(c)*sin(a)*sin(b), cos(b)*cos(c)]
2013년 10월 27일 일요일
ARCBALL
회전축과 회전각도를 결정하여 회전 Quaternion 을 구해냄.
마우스 입력으로 3차원 회전축과 각도를 어떻게 결정하는지 알면 끝.
현재점과 anchor 점을 결정할 때 2D 입력을 spherical mapping을 사용하여 3D Vector로 mapping.
본 논문 :
ARCBALL: a user interface for specifying three-dimensional orientation using a mousehttp://dl.acm.org/citation.cfm?id=155312
2013년 8월 26일 월요일
Eigenvalues of rotation matrix : 0~180 degrees
Eigenvalue의 의미를 보여주는 그래프. y축은 imaginary axis.
추가 1)
When an n×n rotation matrix, Q, does not include −1 as an eigenvalue, so that none of the planar rotations of which it is composed are 180° rotations, then Q+I is an invertible matrix. Most rotation matrices fit this description.
피드 구독하기:
글 (Atom)