Skip to content

Commit

Permalink
fix(mpc): change the way to calculate target steering rate
Browse files Browse the repository at this point in the history
Signed-off-by: Takamasa Horibe <[email protected]>
  • Loading branch information
TakaHoribe authored and tkimura4 committed Oct 17, 2023
1 parent 2dea1c3 commit 5dbc881
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions control/mpc_lateral_controller/src/mpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,10 +753,9 @@ double MPC::calcDesiredSteeringRate(

const size_t STEER_IDX = 2; // for kinematics model

const auto steer_0 = x0(STEER_IDX, 0);
const auto steer_1 = Xex(STEER_IDX, 0);

const auto steer_rate = (steer_1 - steer_0) / predict_dt;
const auto steer_2 = Xex(STEER_IDX + m_vehicle_model_ptr->getDimX(), 0);
const auto steer_rate = (steer_2 - steer_1) / predict_dt;

return steer_rate;
}
Expand Down

0 comments on commit 5dbc881

Please sign in to comment.