one has the problem of multiple definitions of these variables. Is there a possibility to namespace these variables such that one can have multiple instances of the variables, controller1::acadoVariables, controller2::acadoVariables...
Obviously one does not want to change the autogenerated code by hand...
Thank you for any advice!
Last edit: Max B 2016-11-07
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the cpp file, where you define your problem, their is an option to define custom module name. In order to have multiple controllers in the same code, just define different names for different controllers. For eg. If you have two controllers at the bottom of your each cpp file write this:
cpp for nmpc1,
mpc.set( CG_MODULE_NAME, "nmpc1" );
cpp for nmpc2
mpc.set( CG_MODULE_NAME, "nmpc2" );
I hope this helps.
Mohit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I want to include multiple controllers generated by ACADO. Now the problem is since the data is passed to ACADO using global variables
one has the problem of multiple definitions of these variables. Is there a possibility to namespace these variables such that one can have multiple instances of the variables,
controller1::acadoVariables,controller2::acadoVariables...Obviously one does not want to change the autogenerated code by hand...
Thank you for any advice!
Last edit: Max B 2016-11-07
Hey,
In the cpp file, where you define your problem, their is an option to define custom module name. In order to have multiple controllers in the same code, just define different names for different controllers. For eg. If you have two controllers at the bottom of your each cpp file write this:
cpp for nmpc1,
mpc.set( CG_MODULE_NAME, "nmpc1" );
cpp for nmpc2
mpc.set( CG_MODULE_NAME, "nmpc2" );
I hope this helps.
Mohit