You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "main.py", line 177, in
Main()
File "main.py", line 129, in Main
ustar, xstar, cost = CalcInput(A, B, C, x, u)
File "main.py", line 84, in CalcInput
constr = [x[:, t + 1] == A * x[:, t] + B * u[:, t] + C]
File "/usr/local/lib/python3.5/dist-packages/cvxpy/expressions/expression.py", line 46, in cast_op
return binary_op(self, other)
File "/usr/local/lib/python3.5/dist-packages/cvxpy/expressions/expression.py", line 452, in add
return cvxtypes.add_expr()([self, other])
File "/usr/local/lib/python3.5/dist-packages/cvxpy/atoms/affine/add_expr.py", line 33, in init
super(AddExpression, self).init(arg_groups)
File "/usr/local/lib/python3.5/dist-packages/cvxpy/atoms/atom.py", line 45, in init
self._shape = self.shape_from_args()
File "/usr/local/lib/python3.5/dist-packages/cvxpy/atoms/affine/add_expr.py", line 41, in shape_from_args
return u.shape.sum_shapes([arg.shape for arg in self.args])
File "/usr/local/lib/python3.5/dist-packages/cvxpy/utilities/shape.py", line 49, in sum_shapes
len(shapes)" %s" % tuple(shapes))
ValueError: Cannot broadcast dimensions (4,) (4, 1)
The text was updated successfully, but these errors were encountered:
I revised to constr = [x[:, [t + 1]] == A * x[:, [t]] + B * u[:,[t]] + C] and seems solve the problem.
But prob.constriants += at line 99 raised the error of "Attribute error: can's set attribute"
when i run mpc_path_tracking and mpc_sample
Traceback (most recent call last):
File "main.py", line 177, in
Main()
File "main.py", line 129, in Main
ustar, xstar, cost = CalcInput(A, B, C, x, u)
File "main.py", line 84, in CalcInput
constr = [x[:, t + 1] == A * x[:, t] + B * u[:, t] + C]
File "/usr/local/lib/python3.5/dist-packages/cvxpy/expressions/expression.py", line 46, in cast_op
return binary_op(self, other)
File "/usr/local/lib/python3.5/dist-packages/cvxpy/expressions/expression.py", line 452, in add
return cvxtypes.add_expr()([self, other])
File "/usr/local/lib/python3.5/dist-packages/cvxpy/atoms/affine/add_expr.py", line 33, in init
super(AddExpression, self).init(arg_groups)
File "/usr/local/lib/python3.5/dist-packages/cvxpy/atoms/atom.py", line 45, in init
self._shape = self.shape_from_args()
File "/usr/local/lib/python3.5/dist-packages/cvxpy/atoms/affine/add_expr.py", line 41, in shape_from_args
return u.shape.sum_shapes([arg.shape for arg in self.args])
File "/usr/local/lib/python3.5/dist-packages/cvxpy/utilities/shape.py", line 49, in sum_shapes
len(shapes)" %s" % tuple(shapes))
ValueError: Cannot broadcast dimensions (4,) (4, 1)
The text was updated successfully, but these errors were encountered: