Frame tools#
Frame yaw#
The method frame_yaw extracts the yaw of a given frame.
Flatten on floor#
Method flatten_on_floor can be used to flatten a frame on the floor.
It takes its z components, pitch and roll to zero.
Rotation from axis#
The method rotation_from_axis builds a rotation matrix so that the given axis
points towards the given direction. Note that there is an arbitrary choice here, but the result is deterministic.
This can be convenient if you only care a bout a specific axis (for example, a normal surface).
Rotation from axis example
The following example shows the result of rotation_from_axis, asking
a rotation matrix to track the purple arrow.
At each full revolution, the axis is switched periodically between x, y and z.
Optimal transformation#
For two given set of points, the optimal_transformation function can be used to find the optimal transformation between them.
This tool is useful in the case where some points are used to retrieve the corresponding transformation.
Optimal transformation example
In the example below, the optimal transformation is computed between the red points on the floor and the robot legs, allowing to find the optimal match to place the robot on the floor. This can be convenient for state estimation.