Bharath2 / iLQR

iterative Linear Quadratic Regulator with constraints.
BSD 2-Clause "Simplified" License
133 stars 35 forks source link

Cannot determine Numba type of <class 'function'> #5

Open BrenoKenji01 opened 9 months ago

BrenoKenji01 commented 9 months ago

Hi, I am using a python environment named Firedrake (PDE solver) together with another libraries called pygmsh to implement a dynamical system inside the function f(x,u). When I try to run the code, it appears that one of my utility functions has an incompatibility with Numba, even though it doesn't use Numba at all.

Is there any way to make Numba invoked by ilqr ignore my functions?

Bharath2 commented 9 months ago

Try implementing your function like this:

@numba.njit def f(x, u):

code

with objmode():
    # use firedrake
#code
return x_dot

let me know, if it works.