Skip to content

Incorrect calculation of Isometry2d from 3d #1

@joeda

Description

@joeda

In https://github.com/coincar-sim/util_eigen_geometry/blob/release/src/util_eigen_geometry.cpp#L221,

the calculation of the 2D rotation matrix is done by using the (2,2) sized top left block of the 3D rotation matrix. In the general case, this is not a rotation matrix since the determinant = 1 requirement is not fulfilled (except for special cases, such as z pointing upward). For example, a transformation that is slightly pitched by -0.1 will give the following 2D rotation matrix:

0.995 0
0     1

which is not actually a rotation matrix, or for pitch = -1 and roll = 0.6

0.5403,   0.4751
8.61e-17  0.8253

. The yaw angle can be computed from the matrix (see https://en.wikipedia.org/wiki/Rotation_formalisms_in_three_dimensions#Rotation_matrix_%E2%86%92_Euler_angles_(z-x-z_extrinsic) ), but so far I've been unable to find the correct formulation. Any Ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions