setup for discrete traj opt