Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
c844c821
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c844c821
编写于
10月 18, 2019
作者:
J
jmtao
提交者:
Jiaming Tao
10月 18, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
planning: add stage slow_down for emergency_pull_over scenario
上级
bf000edb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
146 addition
and
0 deletion
+146
-0
modules/planning/scenarios/park/emergency_pull_over/BUILD
modules/planning/scenarios/park/emergency_pull_over/BUILD
+2
-0
modules/planning/scenarios/park/emergency_pull_over/stage_slow_down.cc
...ing/scenarios/park/emergency_pull_over/stage_slow_down.cc
+88
-0
modules/planning/scenarios/park/emergency_pull_over/stage_slow_down.h
...ning/scenarios/park/emergency_pull_over/stage_slow_down.h
+56
-0
未找到文件。
modules/planning/scenarios/park/emergency_pull_over/BUILD
浏览文件 @
c844c821
...
...
@@ -7,11 +7,13 @@ cc_library(
srcs
=
[
"emergency_pull_over_scenario.cc"
,
"stage_approach.cc"
,
"stage_slow_down.cc"
,
"stage_standby.cc"
,
],
hdrs
=
[
"emergency_pull_over_scenario.h"
,
"stage_approach.h"
,
"stage_slow_down.h"
,
"stage_standby.h"
,
],
copts
=
[
"-DMODULE_NAME=
\\\"
planning
\\\"
"
],
...
...
modules/planning/scenarios/park/emergency_pull_over/stage_slow_down.cc
0 → 100644
浏览文件 @
c844c821
/******************************************************************************
* Copyright 2019 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
**/
#include "modules/planning/scenarios/park/emergency_pull_over/stage_slow_down.h"
#include <string>
#include <vector>
#include "cyber/common/log.h"
#include "modules/common/vehicle_state/vehicle_state_provider.h"
#include "modules/planning/common/frame.h"
#include "modules/planning/common/planning_context.h"
#include "modules/planning/common/util/common.h"
#include "modules/planning/scenarios/util/util.h"
#include "modules/planning/tasks/deciders/path_bounds_decider/path_bounds_decider.h"
namespace
apollo
{
namespace
planning
{
namespace
scenario
{
namespace
emergency_pull_over
{
using
apollo
::
common
::
TrajectoryPoint
;
EmergencyPullOverStageSlowDown
::
EmergencyPullOverStageSlowDown
(
const
ScenarioConfig
::
StageConfig
&
config
)
:
Stage
(
config
)
{}
Stage
::
StageStatus
EmergencyPullOverStageSlowDown
::
Process
(
const
TrajectoryPoint
&
planning_init_point
,
Frame
*
frame
)
{
ADEBUG
<<
"stage: SlowDown"
;
CHECK_NOTNULL
(
frame
);
scenario_config_
.
CopyFrom
(
GetContext
()
->
scenario_config
);
// set speed_limit to slow down
const
double
adc_speed
=
common
::
VehicleStateProvider
::
Instance
()
->
linear_velocity
();
const
double
target_speed
=
adc_speed
-
scenario_config_
.
max_stop_deceleration
()
*
scenario_config_
.
slow_down_deceleration_time
();
// TODO(all) : to be updated
if
(
frame
->
mutable_reference_line_info
())
{
auto
*
reference_line
=
frame
->
mutable_reference_line_info
()
->
front
().
mutable_reference_line
();
reference_line
->
AddSpeedLimit
(
0.0
,
100.0
,
target_speed
);
}
bool
plan_ok
=
ExecuteTaskOnReferenceLine
(
planning_init_point
,
frame
);
if
(
!
plan_ok
)
{
AERROR
<<
"EmergencyPullOverStageSlowDown planning error"
;
}
// check slow enough
constexpr
double
kSpeedTolarence
=
1.0
;
if
(
adc_speed
-
target_speed
<=
kSpeedTolarence
)
{
return
FinishStage
();
}
return
StageStatus
::
RUNNING
;
}
Stage
::
StageStatus
EmergencyPullOverStageSlowDown
::
FinishStage
()
{
next_stage_
=
ScenarioConfig
::
EMERGENCY_PULL_OVER_APPROACH
;
return
Stage
::
FINISHED
;
}
}
// namespace emergency_pull_over
}
// namespace scenario
}
// namespace planning
}
// namespace apollo
modules/planning/scenarios/park/emergency_pull_over/stage_slow_down.h
0 → 100644
浏览文件 @
c844c821
/******************************************************************************
* Copyright 2019 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
**/
#pragma once
#include "modules/planning/proto/planning_config.pb.h"
#include "modules/planning/scenarios/park/emergency_pull_over/emergency_pull_over_scenario.h"
#include "modules/planning/scenarios/stage.h"
namespace
apollo
{
namespace
planning
{
namespace
scenario
{
namespace
emergency_pull_over
{
struct
EmergencyPullOverContext
;
class
EmergencyPullOverStageSlowDown
:
public
Stage
{
public:
explicit
EmergencyPullOverStageSlowDown
(
const
ScenarioConfig
::
StageConfig
&
config
);
StageStatus
Process
(
const
common
::
TrajectoryPoint
&
planning_init_point
,
Frame
*
frame
)
override
;
EmergencyPullOverContext
*
GetContext
()
{
return
Stage
::
GetContextAs
<
EmergencyPullOverContext
>
();
}
Stage
::
StageStatus
FinishStage
();
private:
ScenarioEmergencyPullOverConfig
scenario_config_
;
};
}
// namespace emergency_pull_over
}
// namespace scenario
}
// namespace planning
}
// namespace apollo
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录