Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
42d857f6
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 搜索 >>
提交
42d857f6
编写于
9月 06, 2017
作者:
Z
Zhang Liangliang
提交者:
Jiangtao Hu
9月 06, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Planning: added UpdateRoutingResponse in reference line provider.
上级
8ac52b79
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
7 deletion
+26
-7
modules/planning/planning.cc
modules/planning/planning.cc
+6
-3
modules/planning/reference_line/reference_line_provider.cc
modules/planning/reference_line/reference_line_provider.cc
+15
-3
modules/planning/reference_line/reference_line_provider.h
modules/planning/reference_line/reference_line_provider.h
+5
-1
未找到文件。
modules/planning/planning.cc
浏览文件 @
42d857f6
...
...
@@ -111,9 +111,7 @@ Status Planning::Init() {
if
(
FLAGS_enable_reference_line_provider_thread
)
{
ReferenceLineProvider
::
instance
()
->
Init
(
pnc_map_
.
get
(),
AdapterManager
::
GetRoutingResponse
()
->
GetLatestObserved
(),
config_
.
reference_line_smoother_config
());
pnc_map_
.
get
(),
config_
.
reference_line_smoother_config
());
}
RegisterPlanners
();
...
...
@@ -163,6 +161,11 @@ void Planning::PublishPlanningPb(ADCTrajectory* trajectory_pb,
void
Planning
::
RunOnce
()
{
const
double
start_timestamp
=
Clock
::
NowInSecond
();
AdapterManager
::
Observe
();
if
(
FLAGS_enable_reference_line_provider_thread
)
{
ReferenceLineProvider
::
instance
()
->
UpdateRoutingResponse
(
AdapterManager
::
GetRoutingResponse
()
->
GetLatestObserved
());
}
ADCTrajectory
not_ready_pb
;
auto
*
not_ready
=
not_ready_pb
.
mutable_decision
()
->
mutable_main_decision
()
...
...
modules/planning/reference_line/reference_line_provider.cc
浏览文件 @
42d857f6
...
...
@@ -42,10 +42,8 @@ ReferenceLineProvider::~ReferenceLineProvider() {
void
ReferenceLineProvider
::
Init
(
const
hdmap
::
PncMap
*
pnc_map
,
const
routing
::
RoutingResponse
&
routing_response
,
const
ReferenceLineSmootherConfig
&
smoother_config
)
{
pnc_map_
=
pnc_map
;
routing_response_
=
routing_response
;
smoother_config_
=
smoother_config
;
is_initialized_
=
true
;
}
...
...
@@ -67,6 +65,13 @@ void ReferenceLineProvider::Stop() {
}
}
void
ReferenceLineProvider
::
UpdateRoutingResponse
(
const
routing
::
RoutingResponse
&
routing_response
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
routing_response_mutex_
);
// TODO: check if routing needs to be updated before assigning.
routing_response_
=
routing_response
;
}
void
ReferenceLineProvider
::
Generate
()
{
while
(
!
is_stop_
)
{
const
auto
&
curr_adc_position
=
...
...
@@ -74,7 +79,14 @@ void ReferenceLineProvider::Generate() {
const
auto
adc_point_enu
=
common
::
util
::
MakePointENU
(
curr_adc_position
.
x
(),
curr_adc_position
.
y
(),
curr_adc_position
.
z
());
if
(
!
CreateReferenceLineFromRouting
(
adc_point_enu
,
routing_response_
))
{
routing
::
RoutingResponse
routing
;
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
routing_response_mutex_
);
// TODO: check if routing needs to be updated before assigning.
routing
=
routing_response_
;
}
if
(
!
CreateReferenceLineFromRouting
(
adc_point_enu
,
routing
))
{
AERROR
<<
"Fail to create reference line at position: "
<<
curr_adc_position
.
ShortDebugString
();
};
...
...
modules/planning/reference_line/reference_line_provider.h
浏览文件 @
42d857f6
...
...
@@ -53,13 +53,14 @@ class ReferenceLineProvider {
~
ReferenceLineProvider
();
void
Init
(
const
hdmap
::
PncMap
*
pnc_map_
,
const
routing
::
RoutingResponse
&
routing_response
,
const
ReferenceLineSmootherConfig
&
smoother_config
);
bool
Start
();
void
Stop
();
void
UpdateRoutingResponse
(
const
routing
::
RoutingResponse
&
routing_response
);
std
::
vector
<
ReferenceLine
>
GetReferenceLines
();
private:
...
...
@@ -75,7 +76,10 @@ class ReferenceLineProvider {
std
::
unique_ptr
<
std
::
thread
>
thread_
;
const
hdmap
::
PncMap
*
pnc_map_
=
nullptr
;
std
::
mutex
routing_response_mutex_
;
routing
::
RoutingResponse
routing_response_
;
ReferenceLineSmootherConfig
smoother_config_
;
bool
is_stop_
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录