This paper addresses the modeling and the control of an autonomous bicycle robot where the reference point is the center of gravity. The controls are based on the wheel heading’s angular velocity and the steering’s angular velocity. They have been developed to drive the autonomous bicycle robot from a given initial state to a final state, so that the total running cost is minimized. To solve the problem, the following approach was used: after having computed the control system Hamiltonian, Pontryagin’s Minimum Principle was applied to derive the feasible controls and the costate system of ordinary differential equations. The feasible controls, derived as functions of the state and costate variables, were substituted into the combined nonlinear state–costate system of ordinary differential equations and yielded a control-free, state–costate system of ordinary differential equations. Such a system was judiciously vectorized to easily enable the application of any computer program written in Matlab, Octave or Scilab. A Matlab computer program, set as the main program, was developed to call a Runge–Kutta function coded into Matlab to solve the combined control-free, state–costate system of ordinary differential equations coded into a Matlab function. After running the program, the following results were obtained: seven feasible state functions from which the feasible trajectory of the robot is derived, seven feasible costate functions, and two feasible control functions. Computational simulations were developed and provided in order to persuade the readers of the effectiveness and the reliability of the approach.