Skip to content

Commit

Permalink
chore: Replace np.matrix with np.array
Browse files Browse the repository at this point in the history
  • Loading branch information
iwishiwasaneagle committed Apr 26, 2023
1 parent 7443b99 commit 5ab2a94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/jdrones/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,12 @@ def solve(A, B, Q, R):
"""

# first, try to solve the ricatti equation
X = np.matrix(scipy.linalg.solve_continuous_are(A, B, Q, R))
X = scipy.linalg.solve_continuous_are(A, B, Q, R)

# compute the LQR gain
K = np.matrix(scipy.linalg.inv(R) * (B.T * X))
K = scipy.linalg.inv(R) @ (B.T @ X)

return np.asarray(K)
return K

def reset(self):
"""
Expand Down

0 comments on commit 5ab2a94

Please sign in to comment.