In order to plan a robot’s movements, we have to understand the relationship between the actuators that we can control and the robot’s resulting position in the environment. For static arms, this is rather straightforward: if we know the position/angle of each joint, we can calculate the position of its end-effectors using trigonometry. This process is known as *forward kinematics*. If we want to calculate the position each joint needs to be at, we need to invert this relationship. This is known as *inverse kinematics.*

The goals of this lecture are

- to introduce the forward kinematics of
*mobile*robots - show how solutions for the inverse kinematics for both static and mobile robots can be derived
- provide an intuition on the relationship between inverse kinematics and path-planning

*when*each movement was executed. A system is non-holonomic when closed trajectories in its configuration space (reminder: the configuration space of a two-link robotic arm is spanned by the possible values of each angle) may

*not*have it return to its original state. A simple arm is holonomic, as each joint position corresponds to a unique position in space. Going through whatever trajectory that comes back to the starting point in configuration space will put the robot at the exact same position. A train on a track is holonomic: moving its wheels backwards by the same amount they have been moving forward brings the train to the exact same position in space. A car and a Roomba are non-holonomic vehicles: performing a straight line and then a right-turn leads to the same amount of wheel rotation than doing a right turn first and then go in a straight line; getting the robot to its initial position requires not only to rewind both wheels by the same amount, but also getting their relative speeds right. (Make a drawing of this.)

It should be clear by now, that for a mobile robot, not only traveled distance per wheel matters, but also the speed of each wheel as a function of time. Lets introduce the following conventions. We establish a coordinate system on the robot and express its speed as a vector . Here and correspond to the *speed* along the x and y directions, whereas corresponds to the rotation around the imaginary z-axis, that you can imagine to be sticking out of the ground. We denote speeds with dots over the variable name, as speed is simply the derivative of distance. We will also establish a world coordinate system , which is known as the *inertial frame* by convention. Think about the robot’s *position *in real quick. It is always zero, as the coordinate system is fixed on the robot. Therefore, is the only interesting quantity here and we need to understand how speeds in map to positions in , which we denote by . These coordinate systems are shown in the figure to the right. Notice that the positioning of the coordinate frames and their orientation are arbitrary. Here, we chose to place the coordinate system in the center of the robot’s axle and align with its default driving direction.

*both*the x-axis and the y-axis of the world coordinate frame. By looking at the figure above, we can derive the following components to . First, . There is also a component of motion coming from . For positive , we can see that the robot actually moves into

*negative*direction. The projection from is therefore given by . We can now write

*this*example. We can now conveniently write

*kinematic constraints*of the robotic wheels. For a standard wheel, the kinematic constraints are that every rotation of the wheel leads to strictly forward or backward motion and does not allow side-way motion or sliding. We can therefore calculate the forward speed of a wheel using its rotational speed (assuming the encoder value/angle is expressed as ) and radius by . This becomes apparent when considering that the circumference of a wheel with radius is . The distance a wheel rolls when turned by the angle (in radians) is therefore . Taking the derivative of this expression on both sides leads to the above expression.

**Exercise: Think about how the robot’s speed along its y-axis is affected by the wheel-speed given the coordinate system in the drawing above. Think about the kinematic constraints that the standard wheels impose.**

Adding the rotation speeds up (with the one around the right wheel being negative based on the right-hand grip rule), leads to

Putting it all together, we can write

Inverse Kinematics

The main problem for the engineer is now to find out how to chose the control parameters to reach a desired position. This problem is known as *inverse kinematics*. Solving the forward kinematics in closed form is not always possible, however. It can be done for the differential wheel platform we studied above. Lets first establish how to calculate the necessary speed of the robot’s center given a desired speed in world coordinates. We can transform the expression by multiplying both sides with the inverse of :

which leads to . Here

which can be determined by actually performing the matrix inversion or by deriving the trigonometric relationships from the drawing. Similarly, we can now solve

for , . (do this!) You will now see that your kinematic constraints actually render some desired velocities, namely those that would lead to non-negative unfeasible.

Inverse Kinematics of a Manipulator Arm

We will now look at the kinematics of a 2-link arm that was introduced in last week’s lecture. Similar to a the process of calculating the required wheel-speed for achieving a desired speed of the *local* coordinate system, we need to solve the equations determining the robot’s forward kinematics by solving for and . This is tricky, however, as we have to deal with complicated trigonometric expressions.

You can give it a shot using *Mathematica* using the code below. For simplicity, and are assumed to be 1.

sol = Solve[Sin[α + β] + Sin[α] == x

&& Cos[α + β] + Cos[α] == y, {α, β}];

min = sol /. {x -> 1, y -> 1}

This will solve for and for x=1, y=1. The solutions for this case are obviously and . (Think about this real quick.) The solutions to this problem are not nice, however, with 8 complicated expressions, 6 of which yielding complex solutions,such as

and

As such solutions quickly become unhandy with more dimensions, you can calculate a numerical solution using an approach that we will see is very similar to path planning in mobile robotics. For this, you need to plot the distance of the end-effector from the desired solution in configuration space. To plot this, you need to solve the forward kinematics for every point in configuration space and use the Euclidian distance to the desired target as height. This is shown below and can be accomplished using the commands

x = 1; y = 1;

Show[Plot3D[ Sqrt[(Sin[α + β] + Sin[α] - x)^2 + (Cos[α + β] + Cos[α] - y)^2], {α, -π/2, π/2}, {β, -π, π}], ListPointPlot3D[{α, β, 0.1} /. {min}]]

The key point here is that the inverse kinematics problem is equivalent to a path-planning problem in the configuration space. How to find shortest paths in space, that is finding the shortest route for a robot to get from A to B will be a major part of this class.

Take-home lessons

- For calculating the forward kinematics of a robot, it is easiest to establish a local coordinate frame on the robot and determine the transformation into the world coordinate first.
- Forward and Inverse Kinematics of a mobile robot are performed with respect to the
*speed*of the robot and not its*position.* - For calculating the effect of each wheel on the speed of the robot, you need to consider the contribution of each wheel independently.
- Calculating the inverse kinematics analytically becomes quickly infeasible. You can then plan in configuration space of the robot using path-planning techniques.

Pingback: Advanced Robotics #3: Forward kinematics of manipulator arms | Correll Lab