Automatic Collision-Free Trajectory Generation and Optimal Base Placement for Collaborative Robotic Car-Painting