25 {
26 static std::pair<double, int> replan_count(0, 0);
27
28
30
31 if (now - replan_count.first > conf->pit_replan_check_time()) {
32 replan_count.first = 0;
33 replan_count.second = 0;
34 }
35
36 if (replan) {
37 if (now - replan_count.first > conf->pit_replan_check_time()) {
38 replan_count.first = now;
39 replan_count.second = 1;
40 } else {
41 replan_count.first = now;
42 replan_count.second++;
43 }
44 }
45
46 const auto& vehicle_param =
48 if (replan_count.second >= conf->pit_replan_check_count() &&
49 abs(speed) < vehicle_param.max_abs_speed_when_stopped()) {
50 return true;
51 } else {
52 return false;
53 }
54}
static const VehicleConfig & GetConfig()
Get the current vehicle configuration.
static double NowInSeconds()
gets the current time in second.
optional VehicleParam vehicle_param