Hi
Hi guys, I have a question regarding the calculation of next states in MPC simulation model. For instance, I have two states variables (y, yaw) defined by MX and 1 control (kappa) input in internal model and get the prediction states which contains these two(y, yaw). And then I passed them to the simulation model to get the update of them. But the simulation model I set contains 3 states (x, y, yaw) and 2 control inputs (delta, acc). When Iβm gonna call the function below to calculate the next states.
The error turns out:
raise Exception(f'AcadosSimSolver.set(): mismatching dimension' \
Exception: AcadosSimSolver.set(): mismatching dimension for field "x" with dimension (np.int32(3), np.int32(0)) (you have (2, 0)).
def sim_x_next_compute(x, u, sim_x_next_integrator):
# Set initial state
sim_x_next_integrator.set("x", x)
sim_x_next_integrator.set("u", u)
# Solve the simulation
status = sim_x_next_integrator.solve()
if status != 0:
raise Exception('acados returned status {}. Exiting.'.format(status))
# Get the solution
x_next_sim = sim_x_next_integrator.get('x')
return x_next_sim
Should I always keep the same dimensions for both models? Only that could I be able to continue the simulation?
Best regards
zikhuan