Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
c9e5e44e
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,发现更多精彩内容 >>
提交
c9e5e44e
编写于
9月 06, 2017
作者:
Z
Zhang Liangliang
提交者:
Dong Li
9月 06, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Planning: added flag for trajectory checker. default = true.
上级
8a650691
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
42 addition
and
27 deletion
+42
-27
modules/planning/common/planning_gflags.cc
modules/planning/common/planning_gflags.cc
+3
-0
modules/planning/common/planning_gflags.h
modules/planning/common/planning_gflags.h
+1
-0
modules/planning/constraint_checker/constraint_checker.cc
modules/planning/constraint_checker/constraint_checker.cc
+15
-15
modules/planning/planner/em/em_planner.cc
modules/planning/planner/em/em_planner.cc
+2
-1
modules/planning/reference_line/reference_line_provider.cc
modules/planning/reference_line/reference_line_provider.cc
+20
-10
modules/planning/reference_line/reference_line_provider.h
modules/planning/reference_line/reference_line_provider.h
+1
-1
未找到文件。
modules/planning/common/planning_gflags.cc
浏览文件 @
c9e5e44e
...
...
@@ -64,6 +64,9 @@ DEFINE_double(trajectory_time_resolution, 0.1,
DEFINE_double
(
output_trajectory_time_resolution
,
0.05
,
"Trajectory time resolution when publish"
);
DEFINE_bool
(
enable_trajectory_check
,
true
,
"Enable sanity check for planning trajectory."
);
DEFINE_double
(
speed_lower_bound
,
0.0
,
"The lowest speed allowed."
);
DEFINE_double
(
speed_upper_bound
,
40.0
,
"The highest speed allowed."
);
...
...
modules/planning/common/planning_gflags.h
浏览文件 @
c9e5e44e
...
...
@@ -45,6 +45,7 @@ DECLARE_double(trajectory_time_resolution);
DECLARE_double
(
output_trajectory_time_resolution
);
// parameters for trajectory sanity check
DECLARE_bool
(
enable_trajectory_check
);
DECLARE_double
(
speed_lower_bound
);
DECLARE_double
(
speed_upper_bound
);
...
...
modules/planning/constraint_checker/constraint_checker.cc
浏览文件 @
c9e5e44e
...
...
@@ -39,38 +39,38 @@ bool ConstraintChecker::ValidTrajectory(
double
t
=
p
.
relative_time
();
double
lon_v
=
p
.
v
();
if
(
!
WithinRange
(
lon_v
,
FLAGS_speed_lower_bound
,
FLAGS_speed_upper_bound
))
{
A
WARN
<<
"Velocity at relative time "
<<
t
<<
" exceeds bound, value: "
<<
lon_v
<<
", bound ["
<<
FLAGS_speed_lower_bound
<<
", "
<<
FLAGS_speed_upper_bound
<<
"]."
;
A
ERROR
<<
"Velocity at relative time "
<<
t
<<
" exceeds bound, value: "
<<
lon_v
<<
", bound ["
<<
FLAGS_speed_lower_bound
<<
", "
<<
FLAGS_speed_upper_bound
<<
"]."
;
return
false
;
}
double
lon_a
=
p
.
a
();
if
(
!
WithinRange
(
lon_a
,
FLAGS_longitudinal_acceleration_lower_bound
,
FLAGS_longitudinal_acceleration_upper_bound
))
{
A
WARN
<<
"Longitudinal acceleration at relative time "
<<
t
<<
" exceeds bound, value: "
<<
lon_a
<<
", bound ["
<<
FLAGS_longitudinal_acceleration_lower_bound
<<
", "
<<
FLAGS_longitudinal_acceleration_upper_bound
<<
"]."
;
A
ERROR
<<
"Longitudinal acceleration at relative time "
<<
t
<<
" exceeds bound, value: "
<<
lon_a
<<
", bound ["
<<
FLAGS_longitudinal_acceleration_lower_bound
<<
", "
<<
FLAGS_longitudinal_acceleration_upper_bound
<<
"]."
;
return
false
;
}
double
lat_a
=
lon_v
*
lon_v
*
p
.
path_point
().
kappa
();
if
(
!
WithinRange
(
lat_a
,
-
FLAGS_lateral_acceleration_bound
,
FLAGS_lateral_acceleration_bound
))
{
A
WARN
<<
"Lateral acceleration at relative time "
<<
t
<<
" exceeds bound, value: "
<<
lat_a
<<
", bound ["
<<
-
FLAGS_lateral_acceleration_bound
<<
", "
<<
FLAGS_lateral_acceleration_bound
<<
"]."
;
A
ERROR
<<
"Lateral acceleration at relative time "
<<
t
<<
" exceeds bound, value: "
<<
lat_a
<<
", bound ["
<<
-
FLAGS_lateral_acceleration_bound
<<
", "
<<
FLAGS_lateral_acceleration_bound
<<
"]."
;
return
false
;
}
double
kappa
=
p
.
path_point
().
kappa
();
if
(
!
WithinRange
(
kappa
,
-
FLAGS_kappa_bound
,
FLAGS_kappa_bound
))
{
A
WARN
<<
"Kappa at relative time "
<<
t
<<
" exceeds bound, value: "
<<
kappa
<<
", bound ["
<<
-
FLAGS_kappa_bound
<<
", "
<<
FLAGS_kappa_bound
<<
"]."
;
A
ERROR
<<
"Kappa at relative time "
<<
t
<<
" exceeds bound, value: "
<<
kappa
<<
", bound ["
<<
-
FLAGS_kappa_bound
<<
", "
<<
FLAGS_kappa_bound
<<
"]."
;
return
false
;
}
}
...
...
modules/planning/planner/em/em_planner.cc
浏览文件 @
c9e5e44e
...
...
@@ -153,7 +153,8 @@ Status EMPlanner::Plan(const TrajectoryPoint& planning_start_point,
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
}
if
(
!
ConstraintChecker
::
ValidTrajectory
(
trajectory
))
{
if
(
FLAGS_enable_trajectory_check
&&
!
ConstraintChecker
::
ValidTrajectory
(
trajectory
))
{
std
::
string
msg
=
"Trajectory cannot pass constraint checker."
;
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
}
...
...
modules/planning/reference_line/reference_line_provider.cc
浏览文件 @
c9e5e44e
...
...
@@ -32,6 +32,12 @@ namespace planning {
using
apollo
::
common
::
VehicleState
;
ReferenceLineProvider
::~
ReferenceLineProvider
()
{
if
(
thread_
&&
thread_
->
joinable
())
{
thread_
->
join
();
}
}
void
ReferenceLineProvider
::
Init
(
const
hdmap
::
PncMap
*
pnc_map
,
const
routing
::
RoutingResponse
&
routing_response
,
...
...
@@ -49,20 +55,24 @@ bool ReferenceLineProvider::Start() {
}
const
auto
&
func
=
[
this
]
{
Generate
();
};
thread_
.
reset
(
new
std
::
thread
(
func
));
return
fals
e
;
return
tru
e
;
}
void
ReferenceLineProvider
::
Generate
()
{
// TODO: implement this function.
const
auto
&
curr_adc_position
=
common
::
VehicleState
::
instance
()
->
pose
().
position
();
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_
))
{
AERROR
<<
"Fail to create reference line at position: "
<<
curr_adc_position
.
ShortDebugString
();
};
while
(
true
)
{
const
auto
&
curr_adc_position
=
common
::
VehicleState
::
instance
()
->
pose
().
position
();
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_
))
{
AERROR
<<
"Fail to create reference line at position: "
<<
curr_adc_position
.
ShortDebugString
();
};
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
duration
<
double
,
std
::
milli
>
(
500
));
}
}
std
::
vector
<
ReferenceLine
>
ReferenceLineProvider
::
GetReferenceLines
()
{
...
...
modules/planning/reference_line/reference_line_provider.h
浏览文件 @
c9e5e44e
...
...
@@ -50,7 +50,7 @@ class ReferenceLineProvider {
/**
* @brief Default destructor.
*/
virtual
~
ReferenceLineProvider
()
=
default
;
~
ReferenceLineProvider
()
;
void
Init
(
const
hdmap
::
PncMap
*
pnc_map_
,
const
routing
::
RoutingResponse
&
routing_response
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录