Skip to content

Commit

Permalink
Planning: init path_reference_decider
Browse files Browse the repository at this point in the history
  • Loading branch information
sjiang2018 authored and jinghaomiao committed May 20, 2020
1 parent 477e0cd commit 458379a
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 17 deletions.
29 changes: 15 additions & 14 deletions modules/planning/proto/planning_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,23 @@ message TaskConfig {
PATH_BOUNDS_DECIDER = 10;
PATH_DECIDER = 11;
PATH_LANE_BORROW_DECIDER = 12;
PATH_REUSE_DECIDER = 13;
RSS_DECIDER = 14;
RULE_BASED_STOP_DECIDER = 15;
SPEED_BOUNDS_PRIORI_DECIDER = 16;
SPEED_BOUNDS_FINAL_DECIDER = 17;
SPEED_DECIDER = 18;
ST_BOUNDS_DECIDER = 19;
PATH_REFERENCE_DECIDER = 13;
PATH_REUSE_DECIDER = 14;
RSS_DECIDER = 15;
RULE_BASED_STOP_DECIDER = 16;
SPEED_BOUNDS_PRIORI_DECIDER = 17;
SPEED_BOUNDS_FINAL_DECIDER = 18;
SPEED_DECIDER = 19;
ST_BOUNDS_DECIDER = 20;
// optimizers
OPEN_SPACE_TRAJECTORY_PARTITION = 20;
OPEN_SPACE_TRAJECTORY_PROVIDER = 21;
PIECEWISE_JERK_NONLINEAR_SPEED_OPTIMIZER = 22;
PIECEWISE_JERK_PATH_OPTIMIZER = 23;
PIECEWISE_JERK_SPEED_OPTIMIZER = 24;
SPEED_HEURISTIC_OPTIMIZER = 25;
OPEN_SPACE_TRAJECTORY_PARTITION = 21;
OPEN_SPACE_TRAJECTORY_PROVIDER = 22;
PIECEWISE_JERK_NONLINEAR_SPEED_OPTIMIZER = 23;
PIECEWISE_JERK_PATH_OPTIMIZER = 24;
PIECEWISE_JERK_SPEED_OPTIMIZER = 25;
SPEED_HEURISTIC_OPTIMIZER = 26;
// other tasks
LEARNING_BASED_TASK = 26;
LEARNING_BASED_TASK = 27;
};

optional TaskType task_type = 1;
Expand Down
1 change: 1 addition & 0 deletions modules/planning/tasks/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ cc_library(
"//modules/planning/tasks/deciders/path_bounds_decider",
"//modules/planning/tasks/deciders/path_decider",
"//modules/planning/tasks/deciders/path_lane_borrow_decider",
"//modules/planning/tasks/deciders/path_reference_decider",
"//modules/planning/tasks/deciders/path_reuse_decider",
"//modules/planning/tasks/deciders/rss_decider",
"//modules/planning/tasks/deciders/rule_based_stop_decider",
Expand Down
25 changes: 25 additions & 0 deletions modules/planning/tasks/deciders/path_reference_decider/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
load("//tools:cpplint.bzl", "cpplint")

package(default_visibility = ["//visibility:public"])

cc_library(
name = "path_reference_decider",
srcs = ["path_reference_decider.cc"],
hdrs = ["path_reference_decider.h"],
copts = ["-DMODULE_NAME=\\\"planning\\\""],
deps = [
"//modules/common/configs:vehicle_config_helper",
"//modules/common/math",
"//modules/common/status",
"//modules/map/proto:map_proto",
"//modules/planning/common:frame",
"//modules/planning/common:path_decision",
"//modules/planning/common:planning_gflags",
"//modules/planning/common:reference_line_info",
"//modules/planning/proto:planning_config_proto",
"//modules/planning/proto:planning_proto",
"//modules/planning/tasks:task",
],
)

cpplint()
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/******************************************************************************
* Copyright 2020 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/

/**
* @file path_reference_decider.cc
*/
#include "modules/planning/tasks/deciders/path_reference_decider/path_reference_decider.h"

#include <string>

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

namespace apollo {
namespace planning {

using apollo::common::Status;

PathReferenceDecider::PathReferenceDecider(const TaskConfig &config)
: Task(config) {}

Status PathReferenceDecider::Execute(Frame *frame,
ReferenceLineInfo *reference_line_info) {
Task::Execute(frame, reference_line_info);
return Status::OK();
}
} // namespace planning
} // namespace apollo
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/******************************************************************************
* Copyright 2020 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/

/**
* @file path_reference_decider.h
**/

#pragma once

#include <string>

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

namespace apollo {
namespace planning {
class PathReferenceDecider : public Task {
public:
explicit PathReferenceDecider(const TaskConfig &config);

apollo::common::Status Execute(
Frame *frame, ReferenceLineInfo *reference_line_info) override;
};

} // namespace planning
} // namespace apollo
9 changes: 6 additions & 3 deletions modules/planning/tasks/task_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@

#include "modules/planning/tasks/task_factory.h"

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

#include "modules/common/status/status.h"
#include "modules/planning/proto/planning_config.pb.h"
#include "modules/planning/tasks/deciders/creep_decider/creep_decider.h"
#include "modules/planning/tasks/deciders/lane_change_decider/lane_change_decider.h"
#include "modules/planning/tasks/deciders/open_space_decider/open_space_fallback_decider.h"
Expand All @@ -32,6 +31,7 @@
#include "modules/planning/tasks/deciders/path_bounds_decider/path_bounds_decider.h"
#include "modules/planning/tasks/deciders/path_decider/path_decider.h"
#include "modules/planning/tasks/deciders/path_lane_borrow_decider/path_lane_borrow_decider.h"
#include "modules/planning/tasks/deciders/path_reference_decider/path_reference_decider.h"
#include "modules/planning/tasks/deciders/path_reuse_decider/path_reuse_decider.h"
#include "modules/planning/tasks/deciders/rss_decider/rss_decider.h"
#include "modules/planning/tasks/deciders/rule_based_stop_decider/rule_based_stop_decider.h"
Expand All @@ -45,7 +45,6 @@
#include "modules/planning/tasks/optimizers/piecewise_jerk_path/piecewise_jerk_path_optimizer.h"
#include "modules/planning/tasks/optimizers/piecewise_jerk_speed/piecewise_jerk_speed_nonlinear_optimizer.h"
#include "modules/planning/tasks/optimizers/piecewise_jerk_speed/piecewise_jerk_speed_optimizer.h"

#include "modules/planning/tasks/task.h"

namespace apollo {
Expand Down Expand Up @@ -99,6 +98,10 @@ void TaskFactory::Init(const PlanningConfig& config) {
[](const TaskConfig& config) -> Task* {
return new PathLaneBorrowDecider(config);
});
task_factory_.Register(TaskConfig::PATH_REFERENCE_DECIDER,
[](const TaskConfig& config) -> Task* {
return new PathReferenceDecider(config);
});
task_factory_.Register(TaskConfig::PATH_REUSE_DECIDER,
[](const TaskConfig& config) -> Task* {
return new PathReuseDecider(config);
Expand Down

0 comments on commit 458379a

Please sign in to comment.