Hauptinhalt

rod2angle

Convert Euler-Rodrigues vector to rotation angles

Description

[rotationAng1,rotationAng2,rotationAng3] = rod2angle(rod) function calculates the set of rotation angles, rotationAng1, rotationAng2, and rotationAng3, for a given Euler-Rodrigues (also known as Rodrigues) vector, rod, using the default rotation sequence of 'ZYX' (yaw, pitch, roll).. The Rodrigues angles represent a passive transformation from frame A to frame B. The resulting rotation angles represent a series of right-hand intrinsic passive rotations from frame A to frame B.

[rotationAng1,rotationAng2,rotationAng3] = rod2angle(rod,rotationSequence) function calculates the set of rotation angles for a given Rodrigues vector and a specified rotation sequence, rotationSequence. The rotationSequence parameter also specifies the order of the three rotation angles.

example

Examples

collapse all

This example shows how to determine rotation angles from vector, [.1 .2 -.1]

r = [.1 .2 -.1];
[yaw, pitch, roll] = rod2angle(r)
yaw = 
-0.1651
pitch = 
0.4074
roll = 
0.1651

Input Arguments

collapse all

m-by-3 matrix containing m Rodrigues vector.

Data Types: double

Rotation sequence, specified as a scalar. For sequences like 'ZXZ', there are two rotations about the same axis, such as two different yaw angles in 'ZXZ'.

Data Types: char | string

Output Arguments

collapse all

First rotation angles, specified as an m-by-1 array, in radians. The rotationAng1 argument represents the first rotation in rotationSequence.

Data Types: double | single

Second rotation angles, specified as an m-by-1 array, in radians. The rotationAng2 argument represents the second rotation in rotationSequence.

Data Types: double | single

Third rotation angles, specified as an m-by-1 array, in radians. The rotationAng3 argument represents the third rotation in rotationSequence.

Data Types: double | single

Algorithms

An Euler-Rodrigues vector b represents a rotation by integrating a direction cosine of a rotation axis with the tangent of half the rotation angle as follows:

b=[bxbybz]

where:

bx=tan(12θ)sx,by=tan(12θ)sy,bz=tan(12θ)sz

are the Rodrigues parameters. Vector s represents a unit vector around which the rotation is performed. Due to the tangent, the rotation vector is indeterminate when the rotation angle equals ±pi radians or ±180 deg. Values can be negative or positive.

References

[1] Dai, J.S. "Euler-Rodrigues formula variations, quaternion conjugation and intrinsic connections." Mechanism and Machine Theory, 92, 144-152. Elsevier, 2015.

Version History

Introduced in R2017a