Abstract— This paper addresses the optimal control of nonholonomic systems through provably correct discretization of the system dynamics. The essence of the approach lies in the discretization of the Lagrange-d’Alembert principle which results in a set of forced discrete Euler-Lagrange equations and discrete nonholonomic constraints that serve as equality constraints for the optimization of a given cost functional. The method is used to investigate optimal trajectories of wheeled robots.