Skip to content

msg: rotation_matrix

Salvo Virga edited this page Sep 22, 2018 · 3 revisions

simple_msgs - RotationMatrix

simple_msgs::RotationMatrix messages represent a 3D rotation in space using a 3x3 matrix using row-major ordering.

A simple_msgs::RotationMatrixStamped message is a RotationMatrix + Header:
the rotation can then be linked to a reference frame defined by Header.frame_id and their timestamp can be stored in Header.timestamp.

In code:

simple_msgs::Header my_header{0, "root", 1.0};
simple_msgs::RotationMatrix my_matrix{1.0, 0.0, 2.0,
                                      4.0, 5.0, 1.0,
                                      0.0, 0.0, 1.0};
simple_msgs::RotationMatrixStamped my_matrixstamped{my_header, my_matrix};

You can manipulate the PoseStamped message using its setters/getters. E.g. my_matrixstamped.setColumn(1, {0.0, 0.0, 1.0});

Identity Matrix

You can get an Identity matrix with:
simple_msgs::RotationMatrix::Identity();

Clone this wiki locally