  In this contribution, we study systems with a finite number of degrees of
freedom as in robotics. A key idea is to consider the mass tensor associated to
the kinetic energy as a metric in a Riemannian configuration space. We apply
Pontryagin's framework to derive an optimal evolution of the control forces and
torques applied to the mechanical system. This equation under covariant form
uses explicitly the Riemann curvature tensor. This contribution is dedicated to
the memory of Claude Vall{\'e}e (1945-2014).
