46 ADEBUG <<
"param: " << param.DebugString();
49 (param.front_edge_to_center() - param.back_edge_to_center()) / 2.0,
50 (param.left_edge_to_center() - param.right_edge_to_center()) / 2.0);
61 vehicle_state_.Clear();
62 front_clear_distance_ = FLAGS_default_front_clear_distance;
70 const std::vector<const Obstacle*>& obstacles) {
71 Vec2d position(vehicle_state_.
x(), vehicle_state_.
y());
75 (param.front_edge_to_center() - param.back_edge_to_center()) / 2.0,
76 (param.left_edge_to_center() - param.right_edge_to_center()) / 2.0);
83 static constexpr double kDistanceThreshold = 50.0;
84 static constexpr double buffer = 0.1;
85 const double impact_region_length =
86 param.length() + buffer + kDistanceThreshold;
87 Box2d ego_front_region(center + unit_vec_heading * kDistanceThreshold / 2.0,
88 vehicle_state_.
heading(), impact_region_length,
89 param.width() + buffer);
91 for (
const auto& obstacle : obstacles) {
92 if (obstacle->IsVirtual() ||
93 !ego_front_region.
HasOverlap(obstacle->PerceptionBoundingBox())) {
98 obstacle->PerceptionBoundingBox().center()) -
101 if (front_clear_distance_ < 0.0 || dist < front_clear_distance_) {
102 front_clear_distance_ = dist;
112 AINFO <<
"distance_to_destination: " << distance_to_destination_;
static const VehicleConfig & GetConfig()
Get the current vehicle configuration.
Rectangular (undirected) bounding box in 2-D.
double diagonal() const
Getter of the size of the diagonal of the box
bool HasOverlap(const LineSegment2d &line_segment) const
Determines whether this box overlaps a given line segment
const Vec2d & center() const
Getter of the center of the box
Implements a class of 2-dimensional vectors.
static Vec2d CreateUnitVec2d(const double angle)
Creates a unit-vector with a given angle to the positive x semi-axis
Vec2d rotate(const double angle) const
rotate the vector by angle.
double DistanceTo(const Vec2d &other) const
Returns the distance to the given vector
bool Update(const common::TrajectoryPoint &start_point, const common::VehicleState &vehicle_state)
common::VehicleState vehicle_state() const
void CalculateCurrentRouteInfo(const ReferenceLineProvider *reference_line_provider)
void CalculateFrontObstacleClearDistance(const std::vector< const Obstacle * > &obstacles)
common::TrajectoryPoint start_point() const
The class of ReferenceLineProvider.
bool GetAdcDis2Destination(double *dis) const
bool GetAdcWaypoint(hdmap::LaneWaypoint *waypoint) const
Planning module main class.
optional VehicleParam vehicle_param
std::string DebugString() const