# "Smooth" inverse kinematics model for 2-wheeled differential drive robot

I have been reading about kinematic models for nonholonomic mobile robots such as differential wheeled robots. The texts I've found so far all give reasonably decent solutions for the forward kinematics problem; but when it comes to inverse kinematics, they weasel out of the question by arguing that for every possible destination pose there are either infinite solutions, or in cases such as $[0 \quad 1 \quad 0]^T$ (since the robot can't move sideways) none at all. Then they advocate a method for driving the robot based on a sequence of straight forward motions alternated with in-place turns.

I find this solution hardly satisfactory. It seems inefficient and inelegant to cause the robot to do a full-stop at every turning point, when a smooth turning would be just as feasible. Also the assertion that some points are "unreachable" seems misleading; maybe there are poses a nonholonomic mobile robot can't reach by maintaining a single set of parameters for a finite time, but clearly, if we vary the parameters over time according to some procedure, and in the absence of obstacles, it should be able to reach any possible pose.

So my question is: what is the inverse kinematics model for a 2-wheeled differential drive robot with shaft half-length $l$, two wheels of equal radii $r$ with adjustable velocities $v_L \ge 0$ and $v_R \ge 0$ (i.e. no in-place turns), and given that we want to minimize the number of changes to the velocities?

• I think this is related: robotics.stackexchange.com/questions/2604/…
– cube
Jun 2, 2014 at 6:08
• The problems are similar, yes, although I gave a narrower description for the kind of solution I'm looking for. Also I don't see how the accepted solution (pure pursuit) could generate a path between any two poses: from what I read, it is only concerned with direction of movement, not the robot's orientation at the destination point. Jun 3, 2014 at 1:03

While there may be an inverse kinematic solution, the most likely reason that your texts are avoiding the problem is because this sort of thing falls more naturally in the domain of AI and path planning.

In the simplest case, you should look at the Dubins path. Balancing constraints like turning radius, maximum speed, etc, is what takes you from infinite solutions to a very reasonable set of possible movements. Given a set of poses, you can plan Dubins paths between them for whatever cost function you prefer.

Here's an example paper on the topic: A Practical Path-planning Algorithm for a Vehicle with a Constrained Turning Radius: a Hamilton-Jacobi Approach.

If I understand correctly, you would like to understand how control a two-wheeled differential drive robot so that you can achieve smooth/elegant driving while arriving at a desired final orientation--this is known as the parking problem. Ian presented an AI approach to the problem, which is interesting, but I would be remiss if I didn't interject with a control theoretic perspective.

Because two-wheeled differential drive robotics are a well-studied robotic platform, we can determine a control law from a model of the dynamics. Differential drive robots can be modeled with unicycle dynamics of the form: $$\dot{z}=\left[\begin{matrix}\dot{x}\\ \dot{y} \\ \dot{\theta} \end{matrix}\right] = \left[\begin{matrix}cos(\theta)&0\\sin(\theta)&0\\0&1\end{matrix}\right] \left[\begin{matrix}v\\\omega\end{matrix}\right],$$ where $x$ and $y$ are Cartesian coordinates of the robot, and $\theta \in (-\pi,\pi]$ is the angle between the heading and the $x$-axis. The input vector $\left[v, \omega \right]^T$ consists of linear and angular velocity inputs.

The parking problem that you mention interest in in your comment has been studied widely. A Smooth Control Law for Graceful Motion of Differential Wheeled Mobile Robots in 2D Environment presents one possible solution.

Another solution to tracking a trajectory is to control a point, which is holonomic, some small distance $l$ away from the center of the the two wheels rather than controlling the unicycle robot directly. To do this, we can derive the following rotation matrix to transform the control law of the robot to the control law of the point: $$\dot{p}=\left[\begin{matrix}\dot{p_x}\\\dot{p_y}\end{matrix}\right]=\left[\begin{matrix}\text{cos}(\theta)&-l\text{sin}(\theta)\\\text{sin}(\theta)&l \text{cos}(\theta)\end{matrix}\right]\left[\begin{matrix}v\\\omega\end{matrix}\right]$$

$\dot{p}$ is the velocity of the point being controlled, and it is decomposed into its $x$ and $y$ components. At this point, control is quite simple, simply control the point directly! Setting $$\dot{p}=u=r(t),$$ accomplishes this, where $u$ is the input, and $r(t)$ is the reference trajectory that you want; this will accomplish smooth movement along the trajectory.

• This is inverse kinematics. Kinematics is the study of the physical arrangement of a system without regard to forces or dynamics. That is, if you move a joint some angle $\theta$, how much of a translation and/or rotation does that create at some other point? Inverse kinematics is the opposite - what joint angle $\theta$ does it take to achieve a desired translation or rotation at the other point? Or, in this case, what wheel speeds does it take to achieve a desired trajectory? You're almost (but not quite!) to the answer. Jun 20, 2016 at 18:32
• In your equation, you give $\dot{p} = [A][v]$, and your control input is $u = \dot{p}$. Well, the kinematic relationship $[A]$ is where the sine/cosine and wheel base $l$ come into play, so to get the linear and angular inputs you need to send to the system you have to take the inverse of the kinematic matrix $[A]$ to get the inverse kinematic equation $[v] = [A]^{-1}u$. Jun 20, 2016 at 18:35