mpc-control 0.2.1__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mpc-control
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: A Python library for Model Predictive Control (MPC)
5
5
  Author-email: Zhen Ni <z.ni@hotmail.com>
6
6
  License-Expression: MIT
@@ -134,14 +134,14 @@ class Ekf:
134
134
  """
135
135
  if self._linearized is None:
136
136
  raise RuntimeError('Should call `predict` before updating.')
137
- c = self._linearized.output_matrix
137
+ c, v = self._system._linearize_output(self._x)
138
138
  # Calculate innovation covariance `S`.
139
139
  S = c @ self._p @ c.T + r
140
140
  # Calculate Kalman gain `k`.
141
141
  # k = p @ C.T @ inv(S) is equivalent to k.T = solve(S, C @ p)
142
142
  k = np.linalg.solve(S, c @ self._p).T
143
143
  # Calculate the updated state vector `x`.
144
- x = self._x + k @ (np.asarray(z) - c @ self._x)
144
+ x = self._x + k @ (np.asarray(z) - c @ self._x - v)
145
145
  # Calculate the updated uncertainty `p` for the state vector.
146
146
  T = np.eye(k.shape[0]) - k @ c
147
147
  p = T @ self._p @ T.T + k @ r @ k.T
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mpc-control
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: A Python library for Model Predictive Control (MPC)
5
5
  Author-email: Zhen Ni <z.ni@hotmail.com>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "mpc-control"
7
- version = "0.2.1"
7
+ version = "0.2.2"
8
8
  description = "A Python library for Model Predictive Control (MPC)"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes