Skip to content

Commit

Permalink
fix(autoware_mpc_lateral_controller): fix variableScope (#9390)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryuta Kambe <[email protected]>
  • Loading branch information
veqcc authored Nov 19, 2024
1 parent a7cc44d commit de9d9cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion control/autoware_mpc_lateral_controller/src/mpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,14 +511,14 @@ MPCMatrix MPC::generateMPCMatrix(

// update mpc matrix
int idx_x_i = i * DIM_X;
int idx_x_i_prev = (i - 1) * DIM_X;
int idx_u_i = i * DIM_U;
int idx_y_i = i * DIM_Y;
if (i == 0) {
m.Aex.block(0, 0, DIM_X, DIM_X) = Ad;
m.Bex.block(0, 0, DIM_X, DIM_U) = Bd;
m.Wex.block(0, 0, DIM_X, 1) = Wd;
} else {
int idx_x_i_prev = (i - 1) * DIM_X;
m.Aex.block(idx_x_i, 0, DIM_X, DIM_X) = Ad * m.Aex.block(idx_x_i_prev, 0, DIM_X, DIM_X);
for (int j = 0; j < i; ++j) {
int idx_u_j = j * DIM_U;
Expand Down

0 comments on commit de9d9cb

Please sign in to comment.