apollo icon indicating copy to clipboard operation
apollo copied to clipboard

why low_speed_penalty equals to exceed_speed_penalty in dp_st_cost.cc?

Open l1xiao opened this issue 8 years ago • 3 comments

In dp_st_cost.cc, code shows that the costs of exceed_speed_penalty and low_speed_penalty are equal. Does it mean that apollo encourages the auto car to run at the limited speed? Is it good to encourage to drive at low speed?

float det_speed = (speed - speed_limit) / speed_limit;
  if (det_speed > 0) {
    cost += config_.exceed_speed_penalty() * config_.default_speed_cost() *
            fabs(speed * speed) * unit_t_; // exceed_speed_penalty is 10 default
  } else if (det_speed < 0) {
    cost += config_.low_speed_penalty() * config_.default_speed_cost() *
            -det_speed * unit_t_; // low_speed_penalty is 10 default
  }

l1xiao avatar Oct 28 '18 02:10 l1xiao

These costs make the car speed inside the speed limit range, you can change them to your preference.

lesun90 avatar Oct 29 '18 12:10 lesun90

Yes, we want the ego car to reach the speed limit but not exceed it, so that it will neither block the road nor has speeding issues.

It is not good to encourage to drive at low speed. We don't want the ego car to stop for no reason on a public road.

lianglia-apollo avatar Jan 19 '19 00:01 lianglia-apollo

Hi @lesun90, hope our answer resolved your question. We will close the issue for now. If you have any additional question, please feel free to open a new issue. Our engineer team are more than happy to help that.

Thank you for supporting Apollo!

jmtao avatar Feb 13 '19 21:02 jmtao