A look-ahead trajectory planning algorithm for spray painting robots with non-spherical wrists