Hi
I am using the python based formulation where I want to limit the sum of control inputs to a specific value. Naturally, I have applied Jbu like this :
Jbu = np.zeros((5,nu)) # matrix for assigning thrust constrain matrix to corresponding input variables
Jbu[0,0] = 1.0
Jbu[1,1] = 1.0
Jbu[2,2] = 1.0
Jbu[3,3] = 1.0
Jbu[4,:] = np.ones((nu,)) # setting the last row to 1.0 so that it makes sum of thrusts
However this produces an error that does not make sense to me because there is a non-zero element in each row.
[[1. 0. 0. 0.]
[0. 1. 0. 0.]
[0. 0. 1. 0.]
[0. 0. 0. 1.]
[1. 1. 1. 1.]]
Traceback (most recent call last):
File "main_build.py", line 63, in <module>
ocp.constraints.Jbu = Jbu
File "/home/pmg/git/acados/interfaces/acados_template/acados_template/acados_ocp.py", line 1726, in Jbu
self.__idxbu = J_to_idx(Jbu)
File "/home/pmg/git/acados/interfaces/acados_template/acados_template/utils.py", line 310, in J_to_idx
raise Exception('Invalid J matrix structure detected, ' \
Exception: Invalid J matrix structure detected, must contain one nonzero element per row.
Would you please help me understand if this is a bug or if I am missing something here?
Thank you!