Tutorial — Rigid3d

Quaterniond q = T_ab.unit_quaternion(); // rotation as quaternion Vector3d t = T_ab.translation();

In robotics, computer vision, and 3D graphics, the ability to represent rotations and translations in 3D space is fundamental. The Rigid3D object (often found in libraries like Sophus , Eigen , geometry_msgs , or tf2 ) is the industry-standard way to do this. Unlike a 4x4 homogeneous matrix, Rigid3D separates rotation (SO(3)) and translation, offering better numerical stability and mathematical clarity.

// Rotation: 90 deg around Z Quaterniond q = Quaterniond(Eigen::AngleAxisd(M_PI/2, Vector3d::UnitZ())); Vector3d t(1.0, 0.0, 0.0); SE3d T_ab(q, t); // Transformation from frame A to frame B rigid3d tutorial

SE3d T_ba = T_ab.inverse();

SE3d T_ab = SE3d(q_ab, t_ab); SE3d T_bc = SE3d(q_bc, t_bc); SE3d T_ac = T_ab * T_bc; Quaterniond q = T_ab

# Rotation: 90 deg around Z r = R.from_euler('z', 90, degrees=True) t = np.array([1.0, 0.0, 0.0]) T = np.eye(4) T[:3,:3] = r.as_matrix() T[:3, 3] = t 4. Applying the Transformation Transform a 3D point ( p = (0, 1, 0) ) from frame A to frame B.

Vector3d p_a(0.0, 1.0, 0.0); Vector3d p_b = T_ab * p_a; std::cout << "p_b: " << p_b.transpose() << std::endl; // Expected: after 90° Z rot: (0,1,0) -> (-1,0,0) then + translation (1,0,0) -> (0,0,0) // Rotation: 90 deg around Z Quaterniond q

p_a = np.array([0, 1, 0]) p_b = T[:3,:3] @ p_a + T[:3,3] print(p_b) # [0., 0., 0.] If you have ( T_bc ) and ( T_ab ), the transform from ( a ) to ( c ) is: