Hey friend,
If you have ever written code for an arm or even a simple 3D character animation you have probably dealt with Inverse Kinematics. You give the computer a target spot. “Put the hand. And the solver figures out what the joint angles need to be.
For an arm that is a fun project.. When you move to a humanoid robot Inverse Kinematics becomes a really tough puzzle. You are not just moving a hand you are managing a lot of joints. If you move the wrist it might accidentally shift the center of mass and send the whole robot falling over.
To make a robot move like a person we need to move from moving parts to Whole-Body Control. Lets look at how the code changes.
1. The Inverse Kinematics Starting Point: “Where do my hands go?”
At its core Inverse Kinematics is about solving an equation. We know where we want the hand to be and we need to find out what the joint angles need to be.
For robots we use Differential Inverse Kinematics. Of solving for the position directly we look at velocity. We use a matrix called the Jacobian matrix to figure out how a tiny change in any joint affects the end of the arm. By using this matrix the robot can calculate how to move its motors to move its hand in a straight line.
2. The Problem: The ” Base”
In a factory arm the base is attached to the floor. In a humanoid robot the base. The pelvis. Is not attached to anything.
This means the Inverse Kinematics solver can’t just think about the arm. It has to think about the body. If the arm reaches forward the pelvis might need to shift to keep the center of mass over the feet. If the code does not think about this the robot will try to reach for something and fall over.
3. Enter Whole-Body Control
This is where things get really interesting. Of running separate code for “move arm” and “stay balanced” Whole-Body Control treats the entire robot as one problem.
Whole-Body Control usually uses a kind of math called Hierarchical Quadratic Program. Imagine a list of tasks with priorities:
- Priority 1: Do not fall over.
- Priority 2: Keep the feet flat on the ground.
- Priority 3: Reach for the mug.
- Priority 4: Look natural.
The solver looks at all these tasks at once. If reaching for the mug would make the robot fall over Whole-Body Control will make the robot reach far as it can without falling. It is a negotiation between physics and what the robot is trying to do.
4. The Programmers Challenge: Latency
When you are running Whole-Body Control you are solving math problems really fast. Once every millisecond.
If the code takes long to calculate the next move the robots motors will jitter. In programming the code needs to be efficient so the robot can move smoothly. We often use libraries to handle the complex math.
My Personal Take
The shift from Inverse Kinematics to Whole-Body Control is a shift in how we think about robots. We used to think of robots, as parts. Now we think of them as a system.
To me the exciting part is that we are starting to use neural networks to control robots. We are getting to the point where the robot can learn what to do on its own of being programmed by an engineer.