From 30ea518121d848926715a1b4849d852f58467b16 Mon Sep 17 00:00:00 2001 From: kosuke55 Date: Wed, 31 Jan 2024 15:50:33 +0900 Subject: [PATCH] add comments Signed-off-by: kosuke55 --- .../vehicle_model/sim_model_delay_steer_acc_geared.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/simulator/simple_planning_simulator/src/simple_planning_simulator/vehicle_model/sim_model_delay_steer_acc_geared.cpp b/simulator/simple_planning_simulator/src/simple_planning_simulator/vehicle_model/sim_model_delay_steer_acc_geared.cpp index fa6849ae9e6b7..f3dd6e0050033 100644 --- a/simulator/simple_planning_simulator/src/simple_planning_simulator/vehicle_model/sim_model_delay_steer_acc_geared.cpp +++ b/simulator/simple_planning_simulator/src/simple_planning_simulator/vehicle_model/sim_model_delay_steer_acc_geared.cpp @@ -72,6 +72,7 @@ double SimModelDelaySteerAccGeared::getWz() } double SimModelDelaySteerAccGeared::getSteer() { + // return measured values with bias added to actual values return state_(IDX::STEER) + steer_bias_; } void SimModelDelaySteerAccGeared::update(const double & dt) @@ -120,6 +121,9 @@ Eigen::VectorXd SimModelDelaySteerAccGeared::calcModel( sat(input(IDX_U::ACCX_DES), vx_rate_lim_, -vx_rate_lim_) * debug_acc_scaling_factor_; const double steer_des = sat(input(IDX_U::STEER_DES), steer_lim_, -steer_lim_) * debug_steer_scaling_factor_; + // NOTE: `steer_des` is calculated by control from measured values. getSteer() also gets the + // measured value. The steer_rate used in the motion calculation is obtained from these + // differences. const double steer_diff = getSteer() - steer_des; const double steer_diff_with_dead_band = std::invoke([&]() { if (steer_diff > steer_dead_band_) {