Apollo 11.0
自动驾驶开放平台
trajectory_cost.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
21#pragma once
22
23#include "modules/common_msgs/config_msgs/vehicle_config.pb.h"
24#include "modules/planning/planning_base/proto/dp_poly_path_config.pb.h"
25
33
34namespace apollo {
35namespace planning {
36
38 public:
39 TrajectoryCost() = default;
40 TrajectoryCost(const DpPolyPathConfig &config,
41 const ReferenceLine &reference_line,
42 const bool is_change_lane_path,
43 const std::vector<const Obstacle *> &obstacles,
44 const common::VehicleParam &vehicle_param,
45 const SpeedData &heuristic_speed_data,
46 const common::SLPoint &init_sl_point,
47 const SLBoundary &adc_sl_boundary);
49 const double start_s, const double end_s,
50 const uint32_t curr_level,
51 const uint32_t total_level);
52
53 private:
54 ComparableCost CalculatePathCost(const QuinticPolynomialCurve1d &curve,
55 const double start_s, const double end_s,
56 const uint32_t curr_level,
57 const uint32_t total_level);
58 ComparableCost CalculateStaticObstacleCost(
59 const QuinticPolynomialCurve1d &curve, const double start_s,
60 const double end_s);
61 ComparableCost CalculateDynamicObstacleCost(
62 const QuinticPolynomialCurve1d &curve, const double start_s,
63 const double end_s) const;
64 ComparableCost GetCostBetweenObsBoxes(
65 const common::math::Box2d &ego_box,
66 const common::math::Box2d &obstacle_box) const;
67
68 FRIEND_TEST(AllTrajectoryTests, GetCostFromObsSL);
69 ComparableCost GetCostFromObsSL(const double adc_s, const double adc_l,
70 const SLBoundary &obs_sl_boundary);
71
72 common::math::Box2d GetBoxFromSLPoint(const common::SLPoint &sl,
73 const double dl) const;
74
75 bool IsOffRoad(const double ref_s, const double l, const double dl,
76 const bool is_change_lane_path);
77
78 const DpPolyPathConfig config_;
79 const ReferenceLine *reference_line_ = nullptr;
80 bool is_change_lane_path_ = false;
81 const common::VehicleParam vehicle_param_;
82 SpeedData heuristic_speed_data_;
83 const common::SLPoint init_sl_point_;
84 const SLBoundary adc_sl_boundary_;
85 uint32_t num_of_time_stamps_ = 0;
86 std::vector<std::vector<common::math::Box2d>> dynamic_obstacle_boxes_;
87 std::vector<double> obstacle_probabilities_;
88
89 std::vector<SLBoundary> static_obstacle_sl_boundaries_;
90};
91
92} // namespace planning
93} // namespace apollo
The class of Box2d.
Rectangular (undirected) bounding box in 2-D.
Definition box2d.h:52
ComparableCost Calculate(const QuinticPolynomialCurve1d &curve, const double start_s, const double end_s, const uint32_t curr_level, const uint32_t total_level)
Planning module main class.
class register implement
Definition arena_queue.h:37