HARPERX
December 19, 2021, 2:53pm
1
Hi,
In acados python interfaces,
getattr(self.shared_lib, f"{model.name}_acados_create_capsule").restype = c_void_p
is used. However, as I have seen, in the generated file the functions were not exported, and the xxx_capsule cannot be found. Only model-related functions are exported in the .so shared library.
FreyJo
December 22, 2021, 1:11pm
2
The function is in the file generated from this template:
{% if constraints.constr_type_e == "BGP" %}
external_function_param_casadi phi_e_constraint;
{% elif constraints.constr_type_e == "BGH" and dims.nh_e > 0 %}
external_function_param_casadi nl_constr_h_e_fun_jac;
external_function_param_casadi nl_constr_h_e_fun;
external_function_param_casadi nl_constr_h_e_fun_jac_hess;
{%- endif %}
} {{ model.name }}_solver_capsule;
{{ model.name }}_solver_capsule * {{ model.name }}_acados_create_capsule(void);
int {{ model.name }}_acados_free_capsule({{ model.name }}_solver_capsule *capsule);
int {{ model.name }}_acados_create({{ model.name }}_solver_capsule * capsule);
/**
* Generic version of {{ model.name }}_acados_create which allows to use a different number of shooting intervals than
* the number used for code generation. If new_time_steps=NULL and n_time_steps matches the number used for code
* generation, the time-steps from code generation is used.
*/
int {{ model.name }}_acados_create_with_discretization({{ model.name }}_solver_capsule * capsule, int n_time_steps, double* new_time_steps);
/**
HARPERX
December 22, 2021, 6:19pm
3
Yes. But it is not exported and is invisible to python nor to shared lib exported-function viewer. Only the casadi func in the model folder can be seen. Is this a problem?