Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
e7d1214e
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,发现更多精彩内容 >>
提交
e7d1214e
编写于
8月 31, 2017
作者:
D
Dong Li
提交者:
Jiangtao Hu
8月 31, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
planning: use planning_init_point to create adc_sl_boundary
上级
e4feca08
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
26 addition
and
36 deletion
+26
-36
modules/planning/common/frame.cc
modules/planning/common/frame.cc
+7
-7
modules/planning/common/reference_line_info.cc
modules/planning/common/reference_line_info.cc
+13
-21
modules/planning/common/reference_line_info.h
modules/planning/common/reference_line_info.h
+4
-6
modules/planning/planner/rtk/rtk_replay_planner_test.cc
modules/planning/planner/rtk/rtk_replay_planner_test.cc
+2
-2
未找到文件。
modules/planning/common/frame.cc
浏览文件 @
e7d1214e
...
...
@@ -94,14 +94,14 @@ bool Frame::InitReferenceLineInfo(
const
std
::
vector
<
ReferenceLine
>
&
reference_lines
)
{
reference_line_info_
.
clear
();
for
(
const
auto
&
reference_line
:
reference_lines
)
{
reference_line_info_
.
emplace_back
(
planning_start_point_
,
pnc_map_
,
reference_line
,
smoother_config_
);
if
(
!
reference_line_info_
.
back
().
Init
())
{
AERROR
<<
"Failed to init reference line info"
;
return
false
;
}
reference_line_info_
.
emplace_back
(
pnc_map_
,
reference_line
,
planning_start_point_
,
smoother_config_
);
}
for
(
auto
&
info
:
reference_line_info_
)
{
if
(
!
info
.
Init
())
{
AERROR
<<
"Failed to init adc sl boundary"
;
return
false
;
}
if
(
!
info
.
AddObstacles
(
obstacles_
.
Items
()))
{
AERROR
<<
"Failed to add obstacles to reference line"
;
return
false
;
...
...
@@ -131,7 +131,7 @@ bool Frame::Init(const PlanningConfig &config,
}
ADEBUG
<<
"Enabled align prediction time ? : "
<<
std
::
boolalpha
<<
FLAGS_align_prediction_time
;
<<
FLAGS_align_prediction_time
;
if
(
FLAGS_align_prediction_time
)
{
AlignPredictionTime
(
current_time_stamp
);
}
...
...
modules/planning/common/reference_line_info.cc
浏览文件 @
e7d1214e
...
...
@@ -24,9 +24,9 @@
#include "modules/planning/proto/sl_boundary.pb.h"
#include "modules/common/configs/vehicle_config_helper.h"
#include "modules/common/util/string_util.h"
#include "modules/common/util/util.h"
#include "modules/common/vehicle_state/vehicle_state.h"
#include "modules/map/hdmap/hdmap_common.h"
#include "modules/planning/common/planning_gflags.h"
#include "modules/planning/reference_line/reference_line_smoother.h"
...
...
@@ -34,28 +34,29 @@
namespace
apollo
{
namespace
planning
{
using
SLPoint
=
apollo
::
common
::
SLPoint
;
using
TrajectoryPoint
=
apollo
::
common
::
TrajectoryPoint
;
using
Vec2d
=
apollo
::
common
::
math
::
Vec2d
;
using
SLPoint
=
apollo
::
common
::
SLPoint
;
using
apollo
::
common
::
VehicleConfigHelper
;
ReferenceLineInfo
::
ReferenceLineInfo
(
const
TrajectoryPoint
&
init_adc_point
,
const
hdmap
::
PncMap
*
pnc_map
,
const
ReferenceLine
&
reference_line
,
const
hdmap
::
PncMap
*
pnc_map
,
const
ReferenceLine
&
reference_line
,
const
TrajectoryPoint
&
init_adc_point
,
const
ReferenceLineSmootherConfig
&
smoother_config
)
:
init_adc_point_
(
init_adc_point
),
pnc_map_
(
pnc_map
),
:
pnc_map_
(
pnc_map
),
reference_line_
(
reference_line
),
init_adc_point_
(
init_adc_point
),
smoother_config_
(
smoother_config
)
{}
bool
ReferenceLineInfo
::
Init
()
{
const
auto
&
box
=
common
::
VehicleState
::
instance
()
->
AdcBoundingBox
();
const
auto
&
vehicle_param
=
VehicleConfigHelper
::
GetConfig
().
vehicle_param
();
const
auto
&
path_point
=
init_adc_point_
.
path_point
();
common
::
math
::
Box2d
box
({
path_point
.
x
(),
path_point
.
y
()},
path_point
.
theta
(),
vehicle_param
.
length
(),
vehicle_param
.
width
());
if
(
!
reference_line_
.
GetSLBoundary
(
box
,
&
adc_sl_boundary_
))
{
AERROR
<<
"Failed to get ADC boundary from box: "
<<
box
.
DebugString
();
return
false
;
}
for
(
const
auto
&
lane_segment
:
reference_line_
.
map_path
().
lane_segments
())
{
reference_line_lane_id_set_
.
insert
(
lane_segment
.
lane
->
id
().
id
());
}
if
(
!
CalculateAdcSmoothReferenLinePoint
())
{
AERROR
<<
"Fail to get ADC smooth reference line point."
;
return
false
;
...
...
@@ -64,23 +65,14 @@ bool ReferenceLineInfo::Init() {
}
bool
ReferenceLineInfo
::
CalculateAdcSmoothReferenLinePoint
()
{
SLPoint
adc_sl_on_raw_ref
;
if
(
!
reference_line_
.
XYToSL
(
Vec2d
(
init_adc_point_
.
path_point
().
x
(),
init_adc_point_
.
path_point
().
y
()),
&
adc_sl_on_raw_ref
))
{
AERROR
<<
"Fail to get sl point for init_adc_point. init_adc_point: "
<<
init_adc_point_
.
DebugString
();
return
false
;
}
const
double
backward_s
=
-
5.0
;
const
double
forward_s
=
10.0
;
const
double
delta_s
=
2.0
;
double
s
=
backward_s
+
adc_sl_
on_raw_ref
.
s
();
double
s
=
backward_s
+
adc_sl_
boundary_
.
start_
s
();
std
::
vector
<
ReferencePoint
>
local_ref_points
;
while
(
s
<=
forward_s
+
adc_sl_
on_raw_ref
.
s
())
{
while
(
s
<=
forward_s
+
adc_sl_
boundary_
.
end_
s
())
{
local_ref_points
.
push_back
(
reference_line_
.
GetReferencePoint
(
s
));
s
+=
delta_s
;
}
...
...
modules/planning/common/reference_line_info.h
浏览文件 @
e7d1214e
...
...
@@ -43,8 +43,8 @@ namespace planning {
class
ReferenceLineInfo
{
public:
explicit
ReferenceLineInfo
(
const
common
::
TrajectoryPoint
&
init_adc_point
,
const
hdmap
::
PncMap
*
pnc_map
,
const
ReferenceLine
&
reference_line
,
const
common
::
TrajectoryPoint
&
init_adc_point
,
const
ReferenceLineSmootherConfig
&
smoother_config
);
bool
Init
();
...
...
@@ -113,8 +113,9 @@ class ReferenceLineInfo {
bool
InitPerceptionSLBoundary
(
PathObstacle
*
path_obstacle
);
bool
CalculateAdcSmoothReferenLinePoint
();
const
common
::
TrajectoryPoint
&
init_adc_point_
;
const
hdmap
::
PncMap
*
pnc_map_
=
nullptr
;
const
ReferenceLine
reference_line_
;
const
common
::
TrajectoryPoint
init_adc_point_
;
/**
* @brief this is the number that measures the goodness of this reference
...
...
@@ -124,7 +125,6 @@ class ReferenceLineInfo {
*/
double
cost_
=
0.0
;
const
ReferenceLine
reference_line_
;
PathDecision
path_decision_
;
PathData
path_data_
;
...
...
@@ -134,12 +134,10 @@ class ReferenceLineInfo {
SLBoundary
adc_sl_boundary_
;
ReferencePoint
adc_smooth_ref_point_
;
ReferenceLineSmootherConfig
smoother_config_
;
const
ReferenceLineSmootherConfig
smoother_config_
;
planning_internal
::
Debug
debug_
;
LatencyStats
latency_stats_
;
std
::
unordered_set
<
std
::
string
>
reference_line_lane_id_set_
;
};
}
// namespace planning
...
...
modules/planning/planner/rtk/rtk_replay_planner_test.cc
浏览文件 @
e7d1214e
...
...
@@ -52,7 +52,7 @@ TEST_F(RTKReplayPlannerTest, ComputeTrajectory) {
localization
.
mutable_pose
()
->
mutable_linear_acceleration
()
->
set_z
(
0.0
);
common
::
VehicleState
::
instance
()
->
Update
(
localization
,
chassis
);
ReferenceLineSmootherConfig
smooth_config
;
ReferenceLineInfo
info
(
start_point
,
nullptr
,
reference_line
,
smooth_config
);
ReferenceLineInfo
info
(
nullptr
,
reference_line
,
start_point
,
smooth_config
);
auto
status
=
planner
.
Plan
(
start_point
,
nullptr
,
&
info
);
const
auto
&
trajectory
=
info
.
trajectory
();
...
...
@@ -93,7 +93,7 @@ TEST_F(RTKReplayPlannerTest, ErrorTest) {
common
::
VehicleState
::
instance
()
->
Update
(
localization
,
chassis
);
ReferenceLine
ref
;
ReferenceLineSmootherConfig
smooth_config
;
ReferenceLineInfo
info
(
start_point
,
nullptr
,
ref
,
smooth_config
);
ReferenceLineInfo
info
(
nullptr
,
ref
,
start_point
,
smooth_config
);
EXPECT_TRUE
(
!
(
planner_with_error_csv
.
Plan
(
start_point
,
nullptr
,
&
info
)).
ok
());
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录