# Planning for a Car Pulling 3 Trailers

This problem involves differential (nonholonomic) constraints on a car-like robot that pulls three trailers. The robot has a limited steering angle, and is required to roll along the ground (i.e., it cannot move sideways). The robot can move in both forward or reverse. The steering angle varies continuously over time.

The equations of motion are borrowed from Murray and Sastry:

dx[0] = Speed*u[0]*cos(x[2]);
dx[1] = Speed*u[0]*sin(x[2]);
dx[2] = Speed*u[0]*tan(x[3])/CarLength;
dx[3] = u[1];
dx[4] = Speed*u[0]*sin(x[2] - x[4])/HitchLength;
dx[5] = Speed*u[0]*cos(x[2] - x[4])*sin(x[4] - x[5])/Hitch2Length;
dx[6] = Speed*u[0]*cos(x[2] - x[4])*cos(x[4] - x[5])*sin(x[5]-x[6])/Hitch3Length;

in which dx represents dx/dt, u represents the input vector, and x represents the state vector.

An RRT that takes into account these differential constraints is shown below.

An example solution path for a simple problem is shown below. The RRTs are shown (projected from a 7D state space by using only xy coordinates of the vertices).

The resulting solution path for a more difficult problem.

An animation of the solution.