holoscan::SO3

Beta
View as Markdown
template <typename K>
class 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.

#include <holoscan/so3.hpp>

Template parameters

K
typename

Scalar type (typically float or double).


Constructors

SO3

holoscan::SO3<K>::SO3()holoscan::SO3<K>::SO3()

Default constructor creates an uninitialized quaternion.

Use identity() to create an identity rotation.


Methods

axis

Vector3<K> holoscan::SO3<K>::axis() const

Get the rotation axis.

Returns: Normalized rotation axis.

angle

K holoscan::SO3<K>::angle() const

Get the angle of rotation around the axis.

This calls a trigonometric function.

Returns: Rotation angle in radians.

quaternion

const Quaternion<K> & holoscan::SO3<K>::quaternion() const

Get the quaternion representation of the rotation.

Returns: Unit quaternion representing the rotation.

matrix

Matrix3<K> holoscan::SO3<K>::matrix() const

Get the 3×3 rotation matrix representation.

Returns: 3×3 rotation matrix.

euler_angles_rpy

Vector3<K> holoscan::SO3<K>::euler_angles_rpy() const

Get the roll, pitch, yaw Euler angles of the rotation.

Returns: Vector containing (roll, pitch, yaw) angles in radians.

inverse

SO3 holoscan::SO3<K>::inverse() constSO3 holoscan::SO3<K>::inverse() const

Get the inverse rotation.

Returns: Inverse rotation.

cast

template <typename S>
SO3<S> holoscan::SO3<K>::cast() constSO3<S> holoscan::SO3<K>::cast() const

Cast to a different scalar type.

Returns: Rotation cast to the target type.

Template parameters

S
typename

Target scalar type.

to_so2_xy

SO2<K> holoscan::SO3<K>::to_so2_xy() constSO2<K> holoscan::SO3<K>::to_so2_xy() const

Convert to a 2D rotation in the XY plane.

Returns: 2D rotation representing the Z-axis component of this 3D rotation.

vector_rotation_jacobian

Matrix<K, 3, 4> holoscan::SO3<K>::vector_rotation_jacobian(
const Vector3<K> &n
) const

Compute the Jacobian of the rotation of a normal vector.

Plane normals only have rotation components.

Returns: 3×4 Jacobian matrix.

Parameters

n
const Vector3<K> &

Normal vector to compute Jacobian for.


Static methods

identity

static SO3 holoscan::SO3<K>::identity()static SO3 holoscan::SO3<K>::identity()

Create the identity rotation.

Returns: Identity rotation (no rotation).

from_scaled_axis

static SO3 holoscan::SO3<K>::from_scaled_axis(static SO3 holoscan::SO3<K>::from_scaled_axis(
const Vector3<K> &axis_angle
)

Create rotation which rotates around the given axis by the magnitude of the axis.

Returns: Rotation around the scaled axis.

Parameters

axis_angle
const Vector3<K> &

Scaled axis vector where the magnitude represents the rotation angle.

from_axis_angle

static SO3 holoscan::SO3<K>::from_axis_angle(static SO3 holoscan::SO3<K>::from_axis_angle(
const Vector3<K> &axis,
K angle
)

Create rotation which rotates by an angle around a given axis.

Returns: Rotation around the given axis by the specified angle.

Parameters

axis
const Vector3<K> &

Rotation axis (will be normalized internally).

angle
K

Rotation angle in radians.

from_angle_axis

static SO3 holoscan::SO3<K>::from_angle_axis(static SO3 holoscan::SO3<K>::from_angle_axis(
K angle,
const Vector3<K> &axis
)

Create rotation from angle and axis (alternative parameter order).

Returns: Rotation around the given axis by the specified angle.

Parameters

angle
K

Rotation angle in radians.

axis
const Vector3<K> &

Rotation axis (will be normalized internally).

from_quaternion

static SO3 holoscan::SO3<K>::from_quaternion(static SO3 holoscan::SO3<K>::from_quaternion(
const Quaternion<K> &quaternion
)

Create rotation from a (not necessarily normalized) quaternion.

Returns: Rotation represented by the normalized quaternion.

Parameters

quaternion
const Quaternion<K> &

Quaternion representation (will be normalized internally).

from_normalized_quaternion

static SO3 holoscan::SO3<K>::from_normalized_quaternion(static SO3 holoscan::SO3<K>::from_normalized_quaternion(
const Quaternion<K> &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

quaternion
const Quaternion<K> &

Normalized quaternion representation.

from_so2_xy

static SO3 holoscan::SO3<K>::from_so2_xy(static SO3 holoscan::SO3<K>::from_so2_xy(
const SO2<K> &rotation
)

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

rotation
const SO2<K> &

2D rotation in the XY plane.

from_matrix

static SO3 holoscan::SO3<K>::from_matrix(static SO3 holoscan::SO3<K>::from_matrix(
const Matrix<K, 3, 3> &matrix
)

Create rotation from a 3×3 rotation matrix.

Returns: Rotation represented by the matrix.

Parameters

matrix
const Matrix<K, 3, 3> &

3×3 Rotation matrix.

from_euler_angles_rpy

static SO3 holoscan::SO3<K>::from_euler_angles_rpy(static SO3 holoscan::SO3<K>::from_euler_angles_rpy(
K roll_angle,
K pitch_angle,
K yaw_angle
)

Create rotation from roll/pitch/yaw Euler angles.

Returns: Rotation representing the given Euler angles.

Parameters

roll_angle
K

Roll angle in radians (rotation around X-axis).

pitch_angle
K

Pitch angle in radians (rotation around Y-axis).

yaw_angle
K

Yaw angle in radians (rotation around Z-axis).


Types

Typedefs

NameDefinition
ScalarK

Member variables

NameTypeDescription
kDimension static constexprint
quaternion_Quaternion< K >Internal quaternion representation.