With the new release of OpenOCL v6.01 you can now use acados
to solve your optimal control problem
and implement a model-predictive controller. Have a look at the cartpole with acados examples
and the closed loop controller example where you can inject disturbances during simulation using a command-line interface.
Get the new version from here and let us know if you have any feedback or questions!