For my thesis, I am using the python interface of acados to prototype an MPC for a multicopter. The generated C code is then used with a C++ ROS-node.
The controlled multicopter is equipped with two sensors with different fields of view. The target point should stay in any of those two FOVs at any time.
As of now, I have implemented the FOV constraint as a soft convex-over-nonlinear constraint and can specify the active sensor using model parameters.
Approaching the target, I want to deactivate the FOV constraint.
I tried extending the constraints to make them irrelevant with:
error: ocp_nlp_constraint_dims_get_from_attr: field lphi not available
I am aware, that the documentation does not state ‘lphi’ as a valid input argument. Using ‘uphi’ - which should work according to the documentation - produces the same kind of error.
Alternatively, I could lower the costs on the slack variables at the relevant time steps, instead of changing the constraints. Which of those methods can be realized, and how?
I do not care that much about the Python interface, as long as there is a solution using C.
I didn’t add lphi, because it shouldn’t really be there.
Say the outer convex function is x^2. If lphi is > 0, then the constraint is not convex anymore.
I saw some comment in the code that lphi should be removed.
How to do it in C:
Check what the constraints_set function in Python does internally.
It basically just calls ocp_nlp_constraints_model_set.