Hi
I am working on a nonlinear model predictive control (NMPC) problem that involves nonlinear constraints for obstacle avoidance. Specifically, I have a separate C file that computes the distance to the closest obstacle and provides the corresponding gradient at a given point. However, this function relies on multiple external libraries, making it impractical to express symbolically in CasADi.
I would like to integrate this constraint efficiently within acados. After reviewing the documentation and examples, I found that the Python interface supports generic external dynamics but does not explicitly mention support for generic external constraints.
Upon further investigation, I came across the nonlinear_chain_ocp_nlp_no_interface.c
example, which includes hand-written constraints. This led me to wonder whether it is possible to integrate my constraint function as a separate C file while still using the Python interface for setting up the problem. My model dynamics and cost functions can be expressed using CasADi, so the only external component is the nonlinear constraint.
My questions are:
- Can the Python interface be used to set up an NMPC problem with external nonlinear constraints defined in a separate C file?
- If so, what steps are required to integrate such a constraint properly?
Any guidance or examples on this topic would be greatly appreciated. Thanks in advance