Dynamically Optimal Trajectories for Earthmoving Excavators