holoscan::SO3
holoscan::SO3
Class representing 3D rotations using the SO(3) group.
This class represents rotations in 3D space as elements of the special orthogonal group SO(3). Internally, rotations are stored as unit quaternions to ensure numerical stability and efficient composition operations.
Template parameters
Scalar type (typically float or double).
Constructors
SO3
Default
Copy
Default constructor creates an uninitialized quaternion.
Use identity() to create an identity rotation.
Methods
axis
Get the rotation axis.
Returns: Normalized rotation axis.
angle
Get the angle of rotation around the axis.
This calls a trigonometric function.
Returns: Rotation angle in radians.
quaternion
Get the quaternion representation of the rotation.
Returns: Unit quaternion representing the rotation.
matrix
Get the 3×3 rotation matrix representation.
Returns: 3×3 rotation matrix.
euler_angles_rpy
Get the roll, pitch, yaw Euler angles of the rotation.
Returns: Vector containing (roll, pitch, yaw) angles in radians.
inverse
Get the inverse rotation.
Returns: Inverse rotation.
cast
Const (1)
Const (2)
Cast to a different scalar type.
Returns: Rotation cast to the target type.
Template parameters
Target scalar type.
to_so2_xy
Convert to a 2D rotation in the XY plane.
Returns: 2D rotation representing the Z-axis component of this 3D rotation.
vector_rotation_jacobian
Compute the Jacobian of the rotation of a normal vector.
Plane normals only have rotation components.
Returns: 3×4 Jacobian matrix.
Parameters
Normal vector to compute Jacobian for.
Static methods
identity
Create the identity rotation.
Returns: Identity rotation (no rotation).
from_scaled_axis
Create rotation which rotates around the given axis by the magnitude of the axis.
Returns: Rotation around the scaled axis.
Parameters
Scaled axis vector where the magnitude represents the rotation angle.
from_axis_angle
Create rotation which rotates by an angle around a given axis.
Returns: Rotation around the given axis by the specified angle.
Parameters
Rotation axis (will be normalized internally).
Rotation angle in radians.
from_angle_axis
Create rotation from angle and axis (alternative parameter order).
Returns: Rotation around the given axis by the specified angle.
Parameters
Rotation angle in radians.
Rotation axis (will be normalized internally).
from_quaternion
Create rotation from a (not necessarily normalized) quaternion.
Returns: Rotation represented by the normalized quaternion.
Parameters
Quaternion representation (will be normalized internally).
from_normalized_quaternion
Create rotation from a normalized quaternion.
This will assert if the quaternion does not have unit length.
Returns: Rotation represented by the quaternion.
Parameters
Normalized quaternion representation.
from_so2_xy
Create a 3D rotation from a 2D rotation in the XY plane.
Returns: 3D rotation equivalent to the 2D rotation around the Z-axis.
Parameters
2D rotation in the XY plane.
from_matrix
Create rotation from a 3×3 rotation matrix.
Returns: Rotation represented by the matrix.
Parameters
3×3 Rotation matrix.
from_euler_angles_rpy
Create rotation from roll/pitch/yaw Euler angles
Create rotation from Euler angles vector
Create rotation from roll/pitch/yaw Euler angles.
Returns: Rotation representing the given Euler angles.
Parameters
Roll angle in radians (rotation around X-axis).
Pitch angle in radians (rotation around Y-axis).
Yaw angle in radians (rotation around Z-axis).