Skip to content
book summaries and quotes

Rigid3d Tutorial _top_ ⏰

In this post, I’ll find modern meaning and interpretation of Miyamoto Musashi’s short classic “Dokkodo”.

Ed Latimore
Ed Latimore
Writer, retired boxer, self-improvement enthusiast

Rigid3d Tutorial _top_ ⏰

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

SE3d T_ba = T_ab.inverse();

T_ac = T_ab @ T_bc Order matters. The rightmost transform is applied first to the point. 6. Inversion The inverse of a rigid transform ( T_ab ) is ( T_ba ). It rotates by ( R^T ) and translates by ( -R^T t ). rigid3d tutorial

Rigid3D typically stores these as a unit quaternion (for rotation) and a 3-vector (for translation). For this tutorial, we'll use the Sophus::SE3d (C++) or scipy.spatial.transform.Rotation (Python). If you're working with ROS, tf2::Transform is analogous. C++ (Eigen + Sophus) #include <sophus/se3.hpp> #include <Eigen/Core> #include <iostream> using Sophus::SE3d; using Eigen::Vector3d; using Eigen::Quaterniond; Python (NumPy + SciPy or transforms3d) import numpy as np from scipy.spatial.transform import Rotation as R # Or use `from transforms3d.quaternions import quat2mat` 3. Creating a Rigid3D Object Let’s create a transformation that represents: rotate 90° about Z-axis, then translate by (1, 0, 0).

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) Quaterniond q = T_ab

T_ba = np.linalg.inv(T_ab) # For rigid transforms, this is more efficient: R_inv = T_ab[:3,:3].T t_inv = -R_inv @ T_ab[:3,3] C++:

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. Inversion The inverse of a rigid transform (

[ T_ac = T_ab \cdot T_bc ]

Ed Latimore
About the author

Ed Latimore

I’m a writer, competitive chess player, Army veteran, physicist, and former professional heavyweight boxer. My work focuses on self-development, realizing your potential, and sobriety—speaking from personal experience, having overcome both poverty and addiction.

Follow me on Twitter.