Main Content

se2

SE(2) homogeneous transformation

    Description

    The se2 object represents an SE(2) transformation as a homogeneous transformation matrix consisting of a translation and rotation in 2-D.

    This object acts like a numerical matrix enabling you to compose poses using multiplication and division.

    Creation

    Description

    transformation = se2 creates an SE(2) transformation representing an identity rotation with no translation.

    transformation = se2(rotation) creates an SE(2) transformation representing a pure rotation defined by the orthonormal rotation rotation with no translation. The rotation matrix is represented by the elements in the top left of the transformation.

    transformation = se2(rotation,translation) creates an SE(2) transformation representing a rotation defined by the orthonormal rotation rotation, and the translation translation. The function applies the rotation matrix first and the translation vector second.

    transformation = se2(transformation) creates an SE(2) transformation representing a translation and rotation as defined by the homogeneous transformation transformation.

    Input Arguments

    expand all

    Orthonormal rotation, specified as a 2-by-2 matrix, a 2-by-2-byM array, a scalar so2 object, or an M-element array of so2 objects. M is the total number of rotations.

    If rotation contains more than one rotation and you also specify translation at construction, the number of translations in translation must be one or equal to the number of rotations in rotation. The resulting number of transformation objects is equal to the larger argument between translation and rotation.

    Example: eye(2)

    Data Types: single | double

    Translation, specified as a N-by-2 array. N is the total number of translations and each translation is of the form [X Y].

    If translation contains more than one translation, the number of rotations in rotation must be one or equal to the number of translations in translation. The resulting number of created transformation objects is equal to the larger argument between translation and rotation.

    Example: [1 4]

    Data Types: single | double

    Homogeneous transformation, specified as a 3-by-3 matrix, a 3-by-3-T or an se3 object. T is the total number of transformations specified.

    If transformation is an array, the resulting number of created transformations objects is equal to T.

    Example: eye(3)

    Data Types: single | double

    Object Functions

    distCalculate distance between transformations
    interpInterpolate between transformations
    mrdivide, ./Transformation right division
    mtimes, *Transformation multiplication
    normalizeNormalize transformation matrix
    rdivide, ./Element-wise transformation right division
    rotmExtract rotation matrix
    times, .*Transformation element-wise multiplication
    tformExtract homogeneous transformation
    transformApply rigid body transformation to points
    trvecExtract translation vector

    Examples

    collapse all

    Define a 3-by-3 rotation matrix and a three-element translation vector.

    rot = eye(3);
    tr = [3 5 2];

    Create the SO(2) and SO(3) rotations using the rotation matrix rot.

    R2d = so2(rot(1:2,1:2))
    R2d = so2
         1     0
         0     1
    
    
    R3d = so3(rot)
    R3d = so3
         1     0     0
         0     1     0
         0     0     1
    
    

    Create the SE(2) and SE(3) rotations using the rotation matrix rot, and the translation vector tr.

    T2d = se2(rot(1:2,1:2),tr(1:2))
    T2d = se2
         1     0     3
         0     1     5
         0     0     1
    
    
    T3d = se3(rot,tr)
    T3d = se3
         1     0     0     3
         0     1     0     5
         0     0     1     2
         0     0     0     1
    
    

    Extended Capabilities

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Version History

    Introduced in R2022b