I did more tests on this. Under C++ environment it could successfully finish the compilation process and generate the revelant C files. However, there are no lbValues and ubValues in the generated "acado_common.h" file. While under MATLAB interface, it couldn't even finish the compilation process. It gives errors like lbValues is not a member of ACADOvariables. Indeed there are no such variables in the "acado_common.h" file.
It is very strange what happened above. On page 110 of the ACADO Toolkit User's Manual, it just says that the "CG_HARDCODE_CONSTRAINT_VALUES" option could be used to specify time-varying constraints, but didn't mention it's not supported in MHE framework.
Francis
Last edit: Francis 2017-05-24
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think that the problem must lie in the way how you are defining the MHE problem since there is no reason why variable constraint values would not work for either MPC or MHE related optimal control problems since they essentially use the same OCP formulation interface. One of the main differences is that you would not define the initial value condition in an estimation related OCP, for which you can use the following option:
mhe.set( 'FIX_INITIAL_STATE', 'NO' );
mhe.set( 'CG_HARDCODE_CONSTRAINT_VALUES', 'NO' );
I tested the above combination of options which seems to work just fine. You should also carefully check the output from the ACADO code generation tool, since it would usually output an error message whenever a certain combination of options is not supported for example.
I hope that this can bring you closer to a solution.
Best,
Rien
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Further tests suggest that it does seem like only certain combinination of options works. For example, the following option works.
mhe.set( 'SPARSE_QP_SOLUTION', 'FULL_CONDENSING_N2');
mhe.set( 'FIX_INITIAL_STATE', 'NO');
mhe.set(' CG_HARDCODE_CONSTRAINT_VALUES', 'NO');
But when I change the 'SPARSE_QP_SOLUTION' to ‘CONDENSING' the compilation fails.
Also, whenever the following two options exist together, the compilation fails.
mhe.set(' CG_HARDCODE_CONSTRAINT_VALUES', 'NO');
mhe.set('CG_USE_ARRIVAL_COST', 'YES');
So it seems like the CG_HARDCODE_CONSTRAINT_VALUES option would work in MHE framework only if FULL_CONDENSING_N2 is used and CG_USE_ARRIVAL_COST is not used.
Best regards,
Francis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I'm trying to implement time-varying constraints in MHE framework but didn't succeed.
In the following post,
https://sourceforge.net/p/acado/discussion/general/thread/8fecd4db/
it says that time-varying constraints are supported in MPC framework. I set the option "CG_HARDCODE_CONSTRAINT_VALUES" to "NO" as instructed there, but it failed to compile.
So I'm wondering is time-varying constraints in MHE framework? Or I missed something?
By the way, I'm using the latest master version in MATLAB interface.
Thank you in advance.
Francis
Last edit: Francis 2017-05-22
I did more tests on this. Under C++ environment it could successfully finish the compilation process and generate the revelant C files. However, there are no lbValues and ubValues in the generated "acado_common.h" file. While under MATLAB interface, it couldn't even finish the compilation process. It gives errors like lbValues is not a member of ACADOvariables. Indeed there are no such variables in the "acado_common.h" file.
It is very strange what happened above. On page 110 of the ACADO Toolkit User's Manual, it just says that the "CG_HARDCODE_CONSTRAINT_VALUES" option could be used to specify time-varying constraints, but didn't mention it's not supported in MHE framework.
Francis
Last edit: Francis 2017-05-24
Hi Francis,
I think that the problem must lie in the way how you are defining the MHE problem since there is no reason why variable constraint values would not work for either MPC or MHE related optimal control problems since they essentially use the same OCP formulation interface. One of the main differences is that you would not define the initial value condition in an estimation related OCP, for which you can use the following option:
mhe.set( 'FIX_INITIAL_STATE', 'NO' );
mhe.set( 'CG_HARDCODE_CONSTRAINT_VALUES', 'NO' );
I tested the above combination of options which seems to work just fine. You should also carefully check the output from the ACADO code generation tool, since it would usually output an error message whenever a certain combination of options is not supported for example.
I hope that this can bring you closer to a solution.
Best,
Rien
Hi Rien,
Further tests suggest that it does seem like only certain combinination of options works. For example, the following option works.
mhe.set( 'SPARSE_QP_SOLUTION', 'FULL_CONDENSING_N2');
mhe.set( 'FIX_INITIAL_STATE', 'NO');
mhe.set(' CG_HARDCODE_CONSTRAINT_VALUES', 'NO');
But when I change the 'SPARSE_QP_SOLUTION' to ‘CONDENSING' the compilation fails.
Also, whenever the following two options exist together, the compilation fails.
mhe.set(' CG_HARDCODE_CONSTRAINT_VALUES', 'NO');
mhe.set('CG_USE_ARRIVAL_COST', 'YES');
So it seems like the CG_HARDCODE_CONSTRAINT_VALUES option would work in MHE framework only if FULL_CONDENSING_N2 is used and CG_USE_ARRIVAL_COST is not used.
Best regards,
Francis
Last edit: Francis 2017-05-25