ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
24.71k stars 9.62k forks source link

question about piecewise jerk problem #15442

Open dajiba6 opened 5 days ago

dajiba6 commented 5 days ago

Why should the maximum steering angle rate be divided by an additional 2 when calculating the dddx bound? Is it for safety margin considerations? Why should dddx be multiplied by an additional delta_s when placed in the boundary matrix?

  const double max_yaw_rate =
      veh_param.max_steer_angle_rate() / veh_param.steer_ratio() / 2.0;
  const double jerk_bound = EstimateJerkBoundary(
      std::fmax(init_state.first[1], 1.0), axis_distance, max_yaw_rate);
  for (int i = 0; i + 1 < n; ++i) {
    variables[2 * n + i].emplace_back(constraint_index, -1.0);
    variables[2 * n + i + 1].emplace_back(constraint_index, 1.0);
    lower_bounds->at(constraint_index) =
        dddx_bound_.first * delta_s_ * scale_factor_[2];
    upper_bounds->at(constraint_index) =
        dddx_bound_.second * delta_s_ * scale_factor_[2];
    ++constraint_index;
  }
ycraurora commented 5 days ago
  1. jerk_bound calculation has changed in Apollo 9.0
    double PathOptimizerUtil::EstimateJerkBoundary(const double vehicle_speed) {
    const auto& veh_param =
      common::VehicleConfigHelper::GetConfig().vehicle_param();
    const double axis_distance = veh_param.wheel_base();
    const double max_yaw_rate =
      veh_param.max_steer_angle_rate() / veh_param.steer_ratio();
    return max_yaw_rate / axis_distance / vehicle_speed;
    }
  2. The state is $X=(x, x^{'}, x^{''})$ in the QP problem. So how to apply dddxbound to X? Use the implicit formula $x{n->n+1}^{'''}=(x{n+1}^{''}-x{n}^{''})/{\Delta}t$, which introduces a delta_s multiplying dddx_bound.
dajiba6 commented 5 days ago

2. problem

thank you my friend, but i still confused about the second question. Isn't the delta_t already included by vehiclespeed? $$\frac{d^3l}{ds^3}=\frac{d\frac{d^2l}{ds^2}}{dt}\cdot\frac{dt}{ds}$$ $$\frac{d^2l}{ds^2}\approx\kappa-\kappa{ref}=\frac{tan(\alpha)}{L}-\kappa{ref}\approx\frac{\alpha}{L}-\kappa{ref}$$ $$\frac{d^3l}{ds^3}=\frac{\alpha'}{Lv}<\frac{\alpha'_{max}}{Lv}$$

ycraurora commented 3 days ago

The variable delta_t is unrelated to delta_s. Below is the discretized formula incorporating a deltas into the jerk bound: $$l{n}^{'''}=\frac{l{n}^{''}-l{n-1}^{''}}{\Delta s}<\frac{\alpha{max}^{'}}{Lv}$$ It should be noted that the jerk bound is applied to $l^{''}$, indicating that the actual bound set in the piecewise jerk problem corresponds to the right-hand side of the inequality presented below: $$l{n}^{''}-l{n-1}^{''}<\Delta s\frac{\alpha{max}^{'}}{Lv}$$

dajiba6 commented 3 days ago

The variable delta_t is unrelated to delta_s. Below is the discretized formula incorporating a delta_s into the jerk bound: ln‴=ln″−ln−1″Δs<αmax′Lv It should be noted that the jerk bound is applied to l″, indicating that the actual bound set in the piecewise jerk problem corresponds to the right-hand side of the inequality presented below: ln″−ln−1″<Δsαmax′Lv

OMG, you are so niubi. Thank you my friend, it really helps. Can I add your wechat to chat chat.