Final project for ME 454: Numerical Methods in Optimal Control of Nonlinear Systems, spring 2016. Done in collaboration with Abhishek Patil.
To determine and implement the optimal control trajectories for start to goal motion of a simple kinematic car robot (iRobot Roomba) while avoiding obstacles in the way. Our initial plan was to use an overhead camera to determine obstacle locations (for use in the barrier functions), however that turned out to be too ambitious for the limited time we had. Instead, we used manually measured coordinates for obstacles.
The system state (q) is comprised of: x position, y position, heading angle, x velocity, and y velocity. The control inputs (u) are: left and right wheel angular velocities. We set arbitrary simple desired state trajectory as well as control trajectory, and locations of obstacles and goal in x-y coordinates. The dynamics of the kinematic car motion are governed by the equations:
The objective (cost) function comprises of the following components:
We performed the iterative LQR algorithm with Armijo Line Search to find the optimal control trajectories required to minimize the cost function - thereby achieving the desired behaviour from the kinematic car. Since we did not use any feedback about the Roomba’s state, there was some drifting in the actual motion compared to the simulated results.
We experimented with two kinds of barrier functions - inverse functions and logarithmic functions. We observed that logarithmic barrier functions tended to behave better for our application - converging faster and more robustly with respect to changes in the cost weights, initial conditions, etc.
The different use-cases we tested were:
As expected, the best (and fastest) performance was achieved in the simplest case without obstacles. But the errors from target position were still good enough with one and two obstacles. Below we show the results with and without obstacles: