Skip to content

Commit

Permalink
planning: remove output pointer check and use CHECK instead of CHECK_…
Browse files Browse the repository at this point in the history
…NOTNULL
  • Loading branch information
mickeyouyou authored and xiaoxq committed Dec 21, 2019
1 parent 9e99439 commit e4b1499
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 17 deletions.
5 changes: 0 additions & 5 deletions modules/planning/navi/decider/navi_path_decider_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,11 @@ class NaviPathDeciderTest : public ::testing::Test {
}

static void InitPlannigConfig(PlanningConfig* const plannig_config) {
CHECK_NOTNULL(plannig_config);
auto* navi_planner_config =
plannig_config->mutable_navigation_planning_config()
->mutable_planner_navi_config();
CHECK_NOTNULL(navi_planner_config);
auto* navi_path_decider_config =
navi_planner_config->mutable_navi_path_decider_config();
CHECK_NOTNULL(navi_path_decider_config);
navi_path_decider_config->set_min_path_length(5.0);
navi_path_decider_config->set_min_look_forward_time(2.0);
navi_path_decider_config->set_max_keep_lane_distance(0.4);
Expand All @@ -69,9 +66,7 @@ class NaviPathDeciderTest : public ::testing::Test {
navi_path_decider_config->clear_move_dest_lane_config_talbe();
auto* move_dest_lane_cfg_table =
navi_path_decider_config->mutable_move_dest_lane_config_talbe();
CHECK_NOTNULL(move_dest_lane_cfg_table);
auto* move_shift_config = move_dest_lane_cfg_table->add_lateral_shift();
CHECK_NOTNULL(move_shift_config);
move_shift_config->set_max_speed(34);
move_shift_config->set_max_move_dest_lane_shift_y(0.45);
}
Expand Down
2 changes: 0 additions & 2 deletions modules/planning/reference_line/reference_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ ReferencePoint ReferenceLine::GetReferencePoint(const double x,

bool ReferenceLine::SLToXY(const SLPoint& sl_point,
common::math::Vec2d* const xy_point) const {
CHECK_NOTNULL(xy_point);
if (map_path_.num_points() < 2) {
AERROR << "The reference line has too few points.";
return false;
Expand All @@ -392,7 +391,6 @@ bool ReferenceLine::SLToXY(const SLPoint& sl_point,

bool ReferenceLine::XYToSL(const common::math::Vec2d& xy_point,
SLPoint* const sl_point) const {
CHECK_NOTNULL(sl_point);
double s = 0.0;
double l = 0.0;
if (!map_path_.GetProjection(xy_point, &s, &l)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@ bool STBoundaryMapper::GetOverlapBoundaryPoints(
std::vector<STPoint>* upper_points,
std::vector<STPoint>* lower_points) const {
// Sanity checks.
CHECK_NOTNULL(upper_points);
CHECK_NOTNULL(lower_points);
DCHECK(upper_points->empty());
DCHECK(lower_points->empty());
DCHECK_GT(path_points.size(), 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,6 @@ void SpeedDecider::AppendIgnoreDecision(Obstacle* obstacle) const {
bool SpeedDecider::CreateStopDecision(const Obstacle& obstacle,
ObjectDecisionType* const stop_decision,
double stop_distance) const {
CHECK_NOTNULL(stop_decision);

const auto& boundary = obstacle.path_st_boundary();

// TODO(all): this is a bug! Cannot mix reference s and path s!
Expand Down Expand Up @@ -379,8 +377,6 @@ bool SpeedDecider::CreateStopDecision(const Obstacle& obstacle,

bool SpeedDecider::CreateFollowDecision(
const Obstacle& obstacle, ObjectDecisionType* const follow_decision) const {
CHECK_NOTNULL(follow_decision);

const double follow_speed = init_point_.v();
const double follow_distance_s =
-StGapEstimator::EstimateProperFollowingGap(follow_speed);
Expand Down Expand Up @@ -415,8 +411,6 @@ bool SpeedDecider::CreateFollowDecision(

bool SpeedDecider::CreateYieldDecision(
const Obstacle& obstacle, ObjectDecisionType* const yield_decision) const {
CHECK_NOTNULL(yield_decision);

PerceptionObstacle::Type obstacle_type = obstacle.Perception().type();
double yield_distance = StGapEstimator::EstimateProperYieldingGap();

Expand Down Expand Up @@ -452,8 +446,6 @@ bool SpeedDecider::CreateYieldDecision(
bool SpeedDecider::CreateOvertakeDecision(
const Obstacle& obstacle,
ObjectDecisionType* const overtake_decision) const {
CHECK_NOTNULL(overtake_decision);

const auto& velocity = obstacle.Perception().velocity();
const double obstacle_speed =
common::math::Vec2d::CreateUnitVec2d(init_point_.path_point().theta())
Expand Down

0 comments on commit e4b1499

Please sign in to comment.