Rigid3d Tutorial !!exclusive!! · No Ads
[ p_B = R_AB \cdot p_A + t_AB ]
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. rigid3d tutorial
[ T_ac = T_ab \cdot T_bc ]
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) [ p_B = R_AB \cdot p_A + 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. [ T_ac = T_ab \cdot T_bc ] Vector3d p_a(0
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:
SE3d T_ba = T_ab.inverse();