Locally Controlled Optimization of Spray Painting Robot Trajectories