Watch: Closed Kinematics Loop problem, old VS new approach
In January, I revisited one of the earliest and most persistent simulation challenges: the closed kinematic chain used in each of Continuity’s legs. URDF lacks native support for closed loops, and PyBullet's rigid body solver struggles with stability when constraints are not explicitly enforced. Previous attempts relied on “fake” revolute joints between femurs and tibias, but these caused instability, especially under dynamic movement, with the robot occasionally entering oscillatory or jumping states. After extensive debugging and physical intuition testing, I adopted a hybrid constraint approach. The solution involved modelling the leg’s closed geometry indirectly via a set of virtual actuators: each tibia’s angle was no longer explicitly controlled, but derived as a function of its corresponding femur's motion using precomputed constants:
This mimicked the effect of parallel bars closing the linkage while retaining numerical stability. The result was a marked reduction in unintended vertical impulses and more consistent leg trajectories across the gait cycle.
With this new leg model in place, I resumed work on the inertial reorientation strategy for microgravity environments. The system now uses a cleaner sensor-feedback loop, combining IMU-based roll and pitch readings with a calculated correction vector to derive leg joint commands. To better formalise this interaction, I started developing a Jacobian-based reorientation framework, mapping leg joint velocities to body angular velocities. Since the system was underactuated (2 roll/pitch targets vs. 8 leg joints), I computed a least-squares solution via the Moore–Penrose pseudoinverse. This allowed selection of optimal joint velocities to reduce attitude error at each timestep:
Where f(q) describes the roll and pitch deviation, and J^+ is the pseudoinverse of the 2×8 Jacobian dynamically recomputed at each configuration using regression-estimated inertia and CoM. The platform no longer exhibited unwanted residual motion during manoeuvring - an indication that angular momentum was being correctly balanced and dissipated across the full system.