# Smoothing Algorithm – Artificial Intelligence for Robotics

In the path planning class, we specified paths as a sequence of points in a 2D grid just like this over here. For the smoothing purposes, we will call each point xi. This is a sequence that goes from x0 to xn-1, and each of the x’s is really a 2-dimensional coordinate, but that should be immaterial to the smoothing. You could do this in 1D, 2D, or 3D. Here’s the smoothing algorithm. Initially we create variable yi that are the same as all the xi’s. Remember that these are the non-smooth locations that the planner has found. Then we optimize two criteria. The first is minimizing this expression over here, and the second looks as follows. In the first one we minimize the error of the ith original point with the ith smooth point, and the second we minimize the distance between consecutive smooth points, both to the square. Here’s a little quiz. If we only apply the first criteria–forget about the second one–will we get the original path, and smooth path, or no path. Please check exactly one of those boxes.