Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
c6b18cca
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 搜索 >>
提交
c6b18cca
编写于
8月 03, 2018
作者:
D
Dong Li
提交者:
Liangliang Zhang
8月 06, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
planning: use original ctpl
上级
89432616
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
67 addition
and
27 deletion
+67
-27
WORKSPACE.in
WORKSPACE.in
+8
-0
modules/planning/common/BUILD
modules/planning/common/BUILD
+1
-0
modules/planning/common/planning_gflags.cc
modules/planning/common/planning_gflags.cc
+2
-2
modules/planning/common/planning_gflags.h
modules/planning/common/planning_gflags.h
+1
-1
modules/planning/common/planning_thread_pool.cc
modules/planning/common/planning_thread_pool.cc
+1
-1
modules/planning/common/reference_line_info.cc
modules/planning/common/reference_line_info.cc
+11
-4
modules/planning/integration_tests/planning_test_base.cc
modules/planning/integration_tests/planning_test_base.cc
+3
-0
modules/planning/planning.cc
modules/planning/planning.cc
+0
-4
modules/planning/tasks/dp_poly_path/dp_road_graph.cc
modules/planning/tasks/dp_poly_path/dp_road_graph.cc
+10
-5
modules/planning/tasks/dp_st_speed/BUILD
modules/planning/tasks/dp_st_speed/BUILD
+1
-0
modules/planning/tasks/dp_st_speed/dp_st_graph.cc
modules/planning/tasks/dp_st_speed/dp_st_graph.cc
+14
-8
modules/planning/tasks/dp_st_speed/dp_st_graph_test.cc
modules/planning/tasks/dp_st_speed/dp_st_graph_test.cc
+1
-2
third_party/ctpl.BUILD
third_party/ctpl.BUILD
+14
-0
未找到文件。
WORKSPACE.in
浏览文件 @
c6b18cca
...
...
@@ -40,6 +40,14 @@ new_http_archive(
url = "file:///home/tmp/benchmark-1.1.0.tar.gz",
)
new_http_archive(
name = "ctpl",
build_file = "third_party/ctpl.BUILD",
sha256 = "8c1cec7c570d6d84be1d29283af5039ea27c3e69703bd446d396424bf619816e",
strip_prefix = "CTPL-ctpl_v.0.0.2",
url = "https://github.com/vit-vit/CTPL/archive/ctpl_v.0.0.2.tar.gz",
)
# cpplint from google style guide
new_git_repository(
name = "google_styleguide",
...
...
modules/planning/common/BUILD
浏览文件 @
c6b18cca
...
...
@@ -193,6 +193,7 @@ cc_library(
"//modules/planning/common/trajectory:publishable_trajectory"
,
"//modules/planning/proto:lattice_structure_proto"
,
"//modules/planning/reference_line"
,
"@ctpl"
,
"@eigen"
,
],
)
...
...
modules/planning/common/planning_gflags.cc
浏览文件 @
c6b18cca
...
...
@@ -276,8 +276,8 @@ DEFINE_bool(enable_follow_accel_constraint, true,
DEFINE_bool
(
enable_sqp_solver
,
true
,
"True to enable SQP solver."
);
/// thread pool
DEFINE_
int32
(
num_thread_planning_thread_pool
,
5
,
"num of thread used in planning thread pool."
);
DEFINE_
uint32
(
max_planning_thread_pool_size
,
5
,
"num of thread used in planning thread pool."
);
DEFINE_bool
(
use_multi_thread_to_add_obstacles
,
false
,
"use multiple thread to add obstacles."
);
DEFINE_bool
(
...
...
modules/planning/common/planning_gflags.h
浏览文件 @
c6b18cca
...
...
@@ -142,7 +142,7 @@ DECLARE_bool(enable_follow_accel_constraint);
DECLARE_bool
(
enable_sqp_solver
);
/// thread pool
DECLARE_
int32
(
num_thread_planning_thread_pool
);
DECLARE_
uint32
(
max_planning_thread_pool_size
);
DECLARE_bool
(
use_multi_thread_to_add_obstacles
);
DECLARE_bool
(
enable_multi_thread_in_dp_poly_path
);
DECLARE_bool
(
enable_multi_thread_in_dp_st_graph
);
...
...
modules/planning/common/planning_thread_pool.cc
浏览文件 @
c6b18cca
...
...
@@ -32,7 +32,7 @@ void PlanningThreadPool::Init() {
return
;
}
thread_pool_
.
reset
(
new
common
::
util
::
ThreadPool
(
FLAGS_
num_thread_planning_thread_pool
));
new
common
::
util
::
ThreadPool
(
FLAGS_
max_planning_thread_pool_size
));
is_initialized
=
true
;
}
...
...
modules/planning/common/reference_line_info.cc
浏览文件 @
c6b18cca
...
...
@@ -24,6 +24,8 @@
#include <functional>
#include <utility>
#include "ctpl/ctpl_stl.h"
#include "modules/planning/proto/sl_boundary.pb.h"
#include "modules/common/adapters/adapter_manager.h"
...
...
@@ -267,14 +269,19 @@ PathObstacle* ReferenceLineInfo::AddObstacle(const Obstacle* obstacle) {
bool
ReferenceLineInfo
::
AddObstacles
(
const
std
::
vector
<
const
Obstacle
*>&
obstacles
)
{
if
(
obstacles
.
empty
())
{
return
true
;
}
if
(
FLAGS_use_multi_thread_to_add_obstacles
)
{
std
::
vector
<
int
>
ret
(
obstacles
.
size
(),
0
);
ctpl
::
thread_pool
pool
(
std
::
min
<
int
>
(
FLAGS_max_planning_thread_pool_size
,
obstacles
.
size
()));
for
(
size_t
i
=
0
;
i
<
obstacles
.
size
();
++
i
)
{
const
auto
*
obstacle
=
obstacles
.
at
(
i
);
PlanningThreadPool
::
instance
()
->
Push
(
std
::
bind
(
&
ReferenceLineInfo
::
AddObstacleHelper
,
this
,
obstacle
,
&
(
ret
[
i
])));
pool
.
push
(
std
::
bind
(
&
ReferenceLineInfo
::
AddObstacleHelper
,
this
,
obstacle
,
&
(
ret
[
i
])));
}
PlanningThreadPool
::
instance
()
->
Synchronize
(
);
pool
.
stop
(
true
);
if
(
std
::
find
(
ret
.
begin
(),
ret
.
end
(),
0
)
!=
ret
.
end
())
{
return
false
;
}
...
...
@@ -397,7 +404,7 @@ bool ReferenceLineInfo::IsChangeLanePath() const {
}
bool
ReferenceLineInfo
::
IsNeighborLanePath
()
const
{
return
Lanes
().
IsNeighborSegment
();
return
Lanes
().
IsNeighborSegment
();
}
std
::
string
ReferenceLineInfo
::
PathSpeedDebugString
()
const
{
...
...
modules/planning/integration_tests/planning_test_base.cc
浏览文件 @
c6b18cca
...
...
@@ -41,6 +41,9 @@ DEFINE_string(test_previous_planning_file, "",
"The previous planning test file"
);
void
PlanningTestBase
::
SetUpTestCase
()
{
FLAGS_use_multi_thread_to_add_obstacles
=
false
;
FLAGS_enable_multi_thread_in_dp_poly_path
=
false
;
FLAGS_enable_multi_thread_in_dp_st_graph
=
false
;
FLAGS_planning_config_file
=
"modules/planning/conf/planning_config.pb.txt"
;
FLAGS_planning_adapter_config_filename
=
"modules/planning/testdata/conf/adapter.conf"
;
...
...
modules/planning/planning.cc
浏览文件 @
c6b18cca
...
...
@@ -132,9 +132,6 @@ Status Planning::Init() {
<<
"Failed to load traffic rule config file "
<<
FLAGS_traffic_rule_config_filename
;
// initialize planning thread pool
PlanningThreadPool
::
instance
()
->
Init
();
// clear planning status
util
::
GetPlanningStatus
()
->
Clear
();
...
...
@@ -489,7 +486,6 @@ void Planning::SetFallbackTrajectory(ADCTrajectory* trajectory_pb) {
void
Planning
::
Stop
()
{
AERROR
<<
"Planning Stop is called"
;
// PlanningThreadPool::instance()->Stop();
if
(
reference_line_provider_
)
{
reference_line_provider_
->
Stop
();
}
...
...
modules/planning/tasks/dp_poly_path/dp_road_graph.cc
浏览文件 @
c6b18cca
...
...
@@ -23,6 +23,8 @@
#include <algorithm>
#include <utility>
#include "ctpl/ctpl_stl.h"
#include "modules/common/proto/error_code.pb.h"
#include "modules/common/proto/pnc_point.pb.h"
#include "modules/planning/proto/planning_internal.pb.h"
...
...
@@ -43,8 +45,8 @@ namespace apollo {
namespace
planning
{
using
apollo
::
common
::
ErrorCode
;
using
apollo
::
common
::
Status
;
using
apollo
::
common
::
SLPoint
;
using
apollo
::
common
::
Status
;
using
apollo
::
common
::
math
::
CartesianFrenetConverter
;
using
apollo
::
common
::
util
::
MakeSLPoint
;
...
...
@@ -150,23 +152,26 @@ bool DPRoadGraph::GenerateMinCostPath(
graph_nodes
.
emplace_back
();
ctpl
::
thread_pool
pool
(
std
::
min
<
std
::
size_t
>
(
FLAGS_max_planning_thread_pool_size
,
level_points
.
size
()));
for
(
size_t
i
=
0
;
i
<
level_points
.
size
();
++
i
)
{
const
auto
&
cur_point
=
level_points
[
i
];
graph_nodes
.
back
().
emplace_back
(
cur_point
,
nullptr
);
auto
&
cur_node
=
graph_nodes
.
back
().
back
();
if
(
FLAGS_enable_multi_thread_in_dp_poly_path
)
{
PlanningThreadPool
::
instance
()
->
Push
(
std
::
bind
(
&
DPRoadGraph
::
UpdateNode
,
this
,
std
::
ref
(
prev_dp_nodes
),
level
,
total_level
,
&
trajectory_cost
,
&
(
front
),
&
(
cur_node
)));
pool
.
push
(
std
::
bind
(
&
DPRoadGraph
::
UpdateNode
,
this
,
std
::
ref
(
prev_dp_nodes
),
level
,
total_
level
,
&
trajectory_cost
,
&
(
front
),
&
(
cur_node
)));
}
else
{
UpdateNode
(
prev_dp_nodes
,
level
,
total_level
,
&
trajectory_cost
,
&
front
,
&
cur_node
);
}
}
if
(
FLAGS_enable_multi_thread_in_dp_poly_path
)
{
PlanningThreadPool
::
instance
()
->
Synchronize
(
);
pool
.
stop
(
true
);
}
}
...
...
modules/planning/tasks/dp_st_speed/BUILD
浏览文件 @
c6b18cca
...
...
@@ -57,6 +57,7 @@ cc_library(
"//modules/planning/proto:planning_config_proto"
,
"//modules/planning/proto:planning_proto"
,
"//modules/planning/tasks/st_graph:st_graph_data"
,
"@ctpl"
,
],
)
...
...
modules/planning/tasks/dp_st_speed/dp_st_graph.cc
浏览文件 @
c6b18cca
...
...
@@ -25,6 +25,8 @@
#include <string>
#include <utility>
#include "ctpl/ctpl_stl.h"
#include "modules/common/proto/pnc_point.pb.h"
#include "modules/common/log.h"
...
...
@@ -172,17 +174,21 @@ Status DpStGraph::CalculateTotalCost() {
int
highest_row
=
0
;
int
lowest_row
=
cost_table_
.
back
().
size
()
-
1
;
for
(
uint32_t
r
=
next_lowest_row
;
r
<=
next_highest_row
;
++
r
)
{
int
count
=
next_highest_row
-
next_lowest_row
+
1
;
if
(
count
>
0
)
{
ctpl
::
thread_pool
pool
(
std
::
min
<
std
::
size_t
>
(
FLAGS_max_planning_thread_pool_size
,
count
));
for
(
uint32_t
r
=
next_lowest_row
;
r
<=
next_highest_row
;
++
r
)
{
if
(
FLAGS_enable_multi_thread_in_dp_st_graph
)
{
pool
.
push
(
std
::
bind
(
&
DpStGraph
::
CalculateCostAt
,
this
,
c
,
r
));
}
else
{
CalculateCostAt
(
c
,
r
);
}
}
if
(
FLAGS_enable_multi_thread_in_dp_st_graph
)
{
PlanningThreadPool
::
instance
()
->
Push
(
std
::
bind
(
&
DpStGraph
::
CalculateCostAt
,
this
,
c
,
r
));
}
else
{
CalculateCostAt
(
c
,
r
);
pool
.
stop
(
true
);
}
}
if
(
FLAGS_enable_multi_thread_in_dp_st_graph
)
{
PlanningThreadPool
::
instance
()
->
Synchronize
();
}
for
(
uint32_t
r
=
next_lowest_row
;
r
<=
next_highest_row
;
++
r
)
{
const
auto
&
cost_cr
=
cost_table_
[
c
][
r
];
...
...
modules/planning/tasks/dp_st_speed/dp_st_graph_test.cc
浏览文件 @
c6b18cca
...
...
@@ -36,10 +36,9 @@ namespace planning {
class
DpStGraphTest
:
public
::
testing
::
Test
{
public:
virtual
void
SetUp
()
{
PlanningThreadPool
::
instance
()
->
Init
();
// dp_config_
PlanningConfig
config
;
FLAGS_enable_multi_thread_in_dp_st_graph
=
true
;
FLAGS_planning_config_file
=
"modules/planning/conf/planning_config.pb.txt"
;
CHECK
(
apollo
::
common
::
util
::
GetProtoFromFile
(
FLAGS_planning_config_file
,
&
config
));
...
...
third_party/ctpl.BUILD
0 → 100644
浏览文件 @
c6b18cca
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
cc_library(
name = "ctpl",
hdrs = [
"ctpl_stl.h",
],
include_prefix = "ctpl",
linkopts = [
"-lpthread",
],
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录