Skip to content

Commit

Permalink
fix(mpc): change the way to calculate target steering rate (#955)
Browse files Browse the repository at this point in the history
Signed-off-by: Takamasa Horibe <[email protected]>
Co-authored-by: Takamasa Horibe <[email protected]>
  • Loading branch information
tkimura4 and TakaHoribe authored Oct 17, 2023
1 parent 2dea1c3 commit fbb8e40
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 fbb8e40

Please sign in to comment.