Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
b4aed1e4
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,发现更多精彩内容 >>
提交
b4aed1e4
编写于
9月 01, 2017
作者:
Z
Zhang Liangliang
提交者:
lianglia-apollo
9月 01, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Planning: added sampling for path_points in st_boundary_mapper.
上级
a3b00642
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
70 addition
and
53 deletion
+70
-53
modules/canbus/can_client/esd/esd_can_client.cc
modules/canbus/can_client/esd/esd_can_client.cc
+1
-1
modules/planning/tasks/st_graph/st_boundary_mapper.cc
modules/planning/tasks/st_graph/st_boundary_mapper.cc
+69
-52
未找到文件。
modules/canbus/can_client/esd/esd_can_client.cc
浏览文件 @
b4aed1e4
...
...
@@ -15,7 +15,7 @@
*****************************************************************************/
/**
* @file esd_can_client.c
pp
* @file esd_can_client.c
c
* @brief the encapsulate call the api of esd can card according to can_client.h
*interface
**/
...
...
modules/planning/tasks/st_graph/st_boundary_mapper.cc
浏览文件 @
b4aed1e4
...
...
@@ -123,6 +123,7 @@ Status StBoundaryMapper::GetGraphBoundary(
return
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
}
AppendBoundary
(
boundary
,
st_boundaries
);
continue
;
}
const
auto
&
decision
=
path_obstacle
->
LongitudinalDecision
();
if
(
decision
.
has_stop
())
{
...
...
@@ -285,13 +286,26 @@ bool StBoundaryMapper::GetOverlapBoundaryPoints(
}
}
}
else
{
DiscretizedPath
discretized_path
(
path_points
);
const
int
default_num_point
=
50
;
DiscretizedPath
discretized_path
;
if
(
path_points
.
size
()
>
2
*
default_num_point
)
{
const
int
ratio
=
path_points
.
size
()
/
default_num_point
;
std
::
vector
<
PathPoint
>
sampled_path_points
;
for
(
size_t
i
=
0
;
i
<
path_points
.
size
();
++
i
)
{
if
(
i
%
ratio
==
0
)
{
sampled_path_points
.
push_back
(
path_points
[
i
]);
}
}
discretized_path
.
set_path_points
(
sampled_path_points
);
}
else
{
discretized_path
.
set_path_points
(
path_points
);
}
for
(
int
i
=
0
;
i
<
trajectory
.
trajectory_point_size
();
++
i
)
{
const
auto
&
trajectory_point
=
trajectory
.
trajectory_point
(
i
);
const
Box2d
obs_box
=
obstacle
.
GetBoundingBox
(
trajectory_point
);
const
double
distance
=
obs_box
.
length
()
+
obs_box
.
width
();
if
(
HasLaneOverlap
(
trajectory_point
,
distance
))
{
if
(
!
HasLaneOverlap
(
trajectory_point
,
distance
))
{
continue
;
}
...
...
@@ -302,62 +316,65 @@ bool StBoundaryMapper::GetOverlapBoundaryPoints(
}
const
double
step_length
=
vehicle_param_
.
length
()
/
2
;
double
path_s
=
path_points
.
front
().
s
()
;
double
path_s
=
0.0
;
while
(
path_s
<
path_points
.
back
().
s
())
{
while
(
path_s
<
discretized_path
.
Length
())
{
const
auto
curr_adc_path_point
=
discretized_path
.
EvaluateUsingLinearApproximation
(
path_s
);
if
(
!
CheckOverlap
(
curr_adc_path_point
,
obs_box
,
st_boundary_config_
.
boundary_buffer
()))
{
path_s
+=
step_length
;
}
// found overlap, start searching with higher resolution
const
double
backward_distance
=
-
step_length
;
const
double
forward_distance
=
vehicle_param_
.
length
()
+
vehicle_param_
.
width
()
+
obs_box
.
length
()
+
obs_box
.
width
();
const
double
fine_tuning_step_length
=
0.2
;
bool
find_low
=
false
;
bool
find_high
=
false
;
double
low_s
=
path_s
+
backward_distance
;
double
high_s
=
path_s
+
forward_distance
;
while
(
low_s
<
high_s
)
{
if
(
find_low
&&
find_high
)
{
break
;
}
if
(
!
find_low
)
{
const
auto
&
point_low
=
discretized_path
.
EvaluateUsingLinearApproximation
(
low_s
);
if
(
!
CheckOverlap
(
point_low
,
obs_box
,
st_boundary_config_
.
boundary_buffer
()))
{
low_s
+=
fine_tuning_step_length
;
}
else
{
find_low
=
true
;
discretized_path
.
EvaluateUsingLinearApproximation
(
path_s
+
discretized_path
.
StartPoint
().
s
());
if
(
CheckOverlap
(
curr_adc_path_point
,
obs_box
,
st_boundary_config_
.
boundary_buffer
()))
{
// found overlap, start searching with higher resolution
const
double
backward_distance
=
-
step_length
;
const
double
forward_distance
=
vehicle_param_
.
length
()
+
vehicle_param_
.
width
()
+
obs_box
.
length
()
+
obs_box
.
width
();
const
double
fine_tuning_step_length
=
0.1
;
bool
find_low
=
false
;
bool
find_high
=
false
;
double
low_s
=
std
::
fmax
(
0.0
,
path_s
+
backward_distance
);
double
high_s
=
std
::
fmin
(
discretized_path
.
Length
(),
path_s
+
forward_distance
);
while
(
low_s
<
high_s
)
{
if
(
find_low
&&
find_high
)
{
break
;
}
}
if
(
!
find_high
)
{
const
auto
&
point_high
=
discretized_path
.
EvaluateUsingLinearApproximation
(
high_s
);
if
(
!
CheckOverlap
(
point_high
,
obs_box
,
st_boundary_config_
.
boundary_buffer
()))
{
high_s
-=
fine_tuning_step_length
;
}
else
{
find_high
=
true
;
if
(
!
find_low
)
{
const
auto
&
point_low
=
discretized_path
.
EvaluateUsingLinearApproximation
(
low_s
+
discretized_path
.
StartPoint
().
s
());
if
(
!
CheckOverlap
(
point_low
,
obs_box
,
st_boundary_config_
.
boundary_buffer
()))
{
low_s
+=
fine_tuning_step_length
;
}
else
{
find_low
=
true
;
}
}
if
(
!
find_high
)
{
const
auto
&
point_high
=
discretized_path
.
EvaluateUsingLinearApproximation
(
high_s
+
discretized_path
.
StartPoint
().
s
());
if
(
!
CheckOverlap
(
point_high
,
obs_box
,
st_boundary_config_
.
boundary_buffer
()))
{
high_s
-=
fine_tuning_step_length
;
}
else
{
find_high
=
true
;
}
}
}
if
(
find_high
&&
find_low
)
{
lower_points
->
emplace_back
(
low_s
-
st_boundary_config_
.
point_extension
(),
trajectory_point_time
);
upper_points
->
emplace_back
(
high_s
+
st_boundary_config_
.
point_extension
(),
trajectory_point_time
);
}
break
;
}
if
(
find_high
&&
find_low
)
{
lower_points
->
emplace_back
(
low_s
-
st_boundary_config_
.
point_extension
(),
trajectory_point_time
);
upper_points
->
emplace_back
(
high_s
+
st_boundary_config_
.
point_extension
(),
trajectory_point_time
);
}
break
;
path_s
+=
step_length
;
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录