Skip to content

Commit 4817541

Browse files
startcodeycool
authored andcommitted
planning: added bypass parked bus test case
1 parent 3e66b45 commit 4817541

File tree

8 files changed

+6454
-2
lines changed

8 files changed

+6454
-2
lines changed

modules/planning/common/path/frenet_frame_path.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ const common::FrenetFramePoint& FrenetFramePath::PointAt(
5959

6060
common::FrenetFramePoint FrenetFramePath::EvaluateByS(const double s) const {
6161
CHECK_GT(points_.size(), 1);
62-
CHECK(s < points_.back().s() + 1.0e-6 && s > points_.front().s() - 1.0e-6);
62+
if (s < points_.front().s()) {
63+
return points_.front();
64+
} else if (s > points_.back().s()) {
65+
return points_.back();
66+
}
6367
auto func = [](const common::FrenetFramePoint& p, const double s) {
6468
return p.s() < s;
6569
};

modules/planning/integration_tests/sunnyvale_big_loop_test.cc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,22 @@ TEST_F(SunnyvaleBigLoopTest, abort_change_lane_for_fast_back_vehicle) {
383383
RUN_GOLDEN_TEST(0);
384384
}
385385

386+
TEST_F(SunnyvaleBigLoopTest, bypass_parked_bus) {
387+
std::string seq_num = "14";
388+
ENABLE_RULE(TrafficRuleConfig::SIGNAL_LIGHT, false);
389+
ENABLE_RULE(TrafficRuleConfig::KEEP_CLEAR, false);
390+
double acc_lower_bound = FLAGS_longitudinal_acceleration_lower_bound;
391+
FLAGS_longitudinal_acceleration_lower_bound = -5.0;
392+
393+
FLAGS_test_routing_response_file = seq_num + "_routing.pb.txt";
394+
FLAGS_test_localization_file = seq_num + "_localization.pb.txt";
395+
FLAGS_test_chassis_file = seq_num + "_chassis.pb.txt";
396+
FLAGS_test_prediction_file = seq_num + "_prediction.pb.txt";
397+
PlanningTestBase::SetUp();
398+
RUN_GOLDEN_TEST(0);
399+
FLAGS_longitudinal_acceleration_lower_bound = acc_lower_bound;
400+
}
401+
386402
} // namespace planning
387403
} // namespace apollo
388404

modules/planning/tasks/path_decider/path_decider.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ bool PathDecider::MakeStaticObstacleDecision(
119119

120120
const auto &sl_boundary = path_obstacle->PerceptionSLBoundary();
121121

122-
if (sl_boundary.start_s() < frenet_points.front().s() ||
122+
if (sl_boundary.end_s() < frenet_points.front().s() ||
123123
sl_boundary.start_s() > frenet_points.back().s()) {
124124
path_decision->AddLongitudinalDecision("PathDecider/not-in-s",
125125
obstacle.Id(), object_decision);
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
engine_started: true
2+
engine_rpm: 1579.75
3+
speed_mps: 5.7388887
4+
odometer_m: 0
5+
fuel_range_m: 0
6+
throttle_percentage: 20.282291
7+
brake_percentage: 13.795682
8+
steering_percentage: 6.93617
9+
steering_torque_nm: -0.6875
10+
parking_brake: false
11+
driving_mode: EMERGENCY_MODE
12+
error_code: NO_ERROR
13+
gear_location: GEAR_DRIVE
14+
header {
15+
timestamp_sec: 1522106647.1464088
16+
module_name: "ReadChassis"
17+
sequence_num: 467
18+
}
19+
signal {
20+
turn_signal: TURN_NONE
21+
horn: false
22+
}
23+
chassis_gps {
24+
latitude: 37.415354666666666
25+
longitude: -122.02169599999999
26+
gps_valid: true
27+
year: 18
28+
month: 3
29+
day: 26
30+
hours: 23
31+
minutes: 24
32+
seconds: 5
33+
compass_direction: 315
34+
pdop: 0.8
35+
is_gps_fault: false
36+
is_inferred: false
37+
altitude: -42.5
38+
heading: 326.62
39+
hdop: 0.4
40+
vdop: 0.8
41+
quality: FIX_3D
42+
num_satellites: 20
43+
gps_speed: 2.2352
44+
}
45+
engage_advice {
46+
advice: READY_TO_ENGAGE
47+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
header {
2+
timestamp_sec: 1522106647.144696
3+
module_name: "ReadLocalization"
4+
sequence_num: 466
5+
}
6+
pose {
7+
position {
8+
x: 586570.3472055248
9+
y: 4141402.880225373
10+
z: -30.680353011945414
11+
}
12+
orientation {
13+
qx: -0.010145286116276428
14+
qy: -0.027475237214918437
15+
qz: 0.32649884305782262
16+
qw: 0.94474371656630041
17+
}
18+
linear_velocity {
19+
x: -3.5773662857560424
20+
y: 4.6205659153984753
21+
z: -0.039802275369643883
22+
}
23+
linear_acceleration {
24+
x: -0.42941585748983885
25+
y: 0.013148328436435376
26+
z: -0.9648528347682479
27+
}
28+
angular_velocity {
29+
x: -0.01418661182677949
30+
y: 0.016210112362066036
31+
z: 0.076738693818134945
32+
}
33+
heading: 2.235445261914399
34+
linear_acceleration_vrf {
35+
x: 0.0710412859916687
36+
y: -0.052861869335174561
37+
z: 8.8451430201530457
38+
}
39+
angular_velocity_vrf {
40+
x: 0.0023441799302176968
41+
y: 0.018646939005570923
42+
z: 0.077457416126574155
43+
}
44+
euler_angles {
45+
x: -0.037119180370530878
46+
y: -0.045336014204200852
47+
z: 0.66464893511950229
48+
}
49+
}
50+
uncertainty {
51+
position_std_dev {
52+
x: 0.010972627294067385
53+
y: 0.0094467178561181558
54+
z: 0.012520283942028898
55+
}
56+
orientation_std_dev {
57+
x: 0.059240168003579841
58+
y: 0.0693377333103652
59+
z: 0.049555902244396544
60+
}
61+
linear_velocity_std_dev {
62+
x: 0.012027445662990917
63+
y: 0.011323486403483626
64+
z: 0.0065185331184555474
65+
}
66+
}
67+
measurement_time: 1522106647.105104

0 commit comments

Comments
 (0)