Energy-Efficient Trajectory Planning for Robot Manipulators