Skip to content

Commit

Permalink
planning: updated static obstacle buffer in path_decider
Browse files Browse the repository at this point in the history
  • Loading branch information
sjiang2018 committed Nov 1, 2019
1 parent 6feedcb commit a9406dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modules/planning/tasks/deciders/path_decider/path_decider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ bool PathDecider::MakeStaticObstacleDecision(
common::VehicleConfigHelper::GetConfig().vehicle_param().width() / 2.0;
const double lateral_radius = half_width + FLAGS_lateral_ignore_buffer;

// Go through every obstalce and make decisions.
// Go through every obstacle and make decisions.
for (const auto *obstacle : path_decision->obstacles().Items()) {
const std::string &obstacle_id = obstacle->Id();
const std::string obstacle_type_name =
Expand Down Expand Up @@ -156,7 +156,8 @@ bool PathDecider::MakeStaticObstacleDecision(
const auto frenet_point = frenet_path.GetNearestPoint(sl_boundary);
const double curr_l = frenet_point.l();
double min_nudge_l =
half_width + FLAGS_static_obstacle_nudge_l_buffer / 2.0;
half_width +
config_.path_decider_config().static_obstacle_buffer() / 2.0;

if (curr_l - lateral_radius > sl_boundary.end_l() ||
curr_l + lateral_radius < sl_boundary.start_l()) {
Expand Down Expand Up @@ -187,15 +188,17 @@ bool PathDecider::MakeStaticObstacleDecision(
// LEFT_NUDGE
ObjectNudge *object_nudge_ptr = object_decision.mutable_nudge();
object_nudge_ptr->set_type(ObjectNudge::LEFT_NUDGE);
object_nudge_ptr->set_distance_l(FLAGS_static_obstacle_nudge_l_buffer);
object_nudge_ptr->set_distance_l(
config_.path_decider_config().static_obstacle_buffer());
path_decision->AddLateralDecision("PathDecider/left-nudge",
obstacle->Id(), object_decision);
} else if (sl_boundary.start_l() > curr_l + min_nudge_l) { // &&
// sl_boundary.start_l() < curr_l + min_nudge_l + 0.3) {
// RIGHT_NUDGE
ObjectNudge *object_nudge_ptr = object_decision.mutable_nudge();
object_nudge_ptr->set_type(ObjectNudge::RIGHT_NUDGE);
object_nudge_ptr->set_distance_l(-FLAGS_static_obstacle_nudge_l_buffer);
object_nudge_ptr->set_distance_l(
-config_.path_decider_config().static_obstacle_buffer());
path_decision->AddLateralDecision("PathDecider/right-nudge",
obstacle->Id(), object_decision);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <string>

#include "modules/planning/proto/planning_config.pb.h"
#include "modules/planning/tasks/task.h"

namespace apollo {
Expand Down

0 comments on commit a9406dd

Please sign in to comment.