Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
82436ca6
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,发现更多精彩内容 >>
提交
82436ca6
编写于
8月 22, 2017
作者:
A
Aaron Xiao
提交者:
Jiangtao Hu
8月 22, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Planning: Simplify function names of converting between xy and sl points.
上级
1b2227d4
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
43 addition
and
57 deletion
+43
-57
modules/planning/common/path/path_data.cc
modules/planning/common/path/path_data.cc
+3
-4
modules/planning/common/path_obstacle.cc
modules/planning/common/path_obstacle.cc
+1
-1
modules/planning/common/reference_line_info.cc
modules/planning/common/reference_line_info.cc
+2
-2
modules/planning/planner/em/decider.cc
modules/planning/planner/em/decider.cc
+2
-4
modules/planning/planner/em/em_planner.cc
modules/planning/planner/em/em_planner.cc
+4
-4
modules/planning/reference_line/reference_line.cc
modules/planning/reference_line/reference_line.cc
+5
-7
modules/planning/reference_line/reference_line.h
modules/planning/reference_line/reference_line.h
+4
-4
modules/planning/reference_line/reference_line_smoother.cc
modules/planning/reference_line/reference_line_smoother.cc
+1
-2
modules/planning/tasks/dp_poly_path/dp_road_graph.cc
modules/planning/tasks/dp_poly_path/dp_road_graph.cc
+4
-7
modules/planning/tasks/qp_spline_path/qp_frenet_frame.cc
modules/planning/tasks/qp_spline_path/qp_frenet_frame.cc
+6
-9
modules/planning/tasks/qp_spline_path/qp_spline_path_generator.cc
...planning/tasks/qp_spline_path/qp_spline_path_generator.cc
+1
-1
modules/planning/tasks/st_graph/st_boundary_mapper.cc
modules/planning/tasks/st_graph/st_boundary_mapper.cc
+6
-6
modules/planning/tasks/traffic_decider/traffic_decider.cc
modules/planning/tasks/traffic_decider/traffic_decider.cc
+4
-6
未找到文件。
modules/planning/common/path/path_data.cc
浏览文件 @
82436ca6
...
...
@@ -158,8 +158,7 @@ bool PathData::FrenetToCartesian(const FrenetFramePath &frenet_path,
common
::
math
::
Vec2d
cartesian_point
;
sl_point
.
set_s
(
frenet_point
.
s
());
sl_point
.
set_l
(
frenet_point
.
l
());
if
(
!
reference_line_
->
get_point_in_cartesian_frame
(
sl_point
,
&
cartesian_point
))
{
if
(
!
reference_line_
->
sl_to_xy
(
sl_point
,
&
cartesian_point
))
{
AERROR
<<
"Fail to convert sl point to xy point"
;
return
false
;
}
...
...
@@ -197,8 +196,8 @@ bool PathData::CartesianToFrenet(const DiscretizedPath &discretized_path,
for
(
const
auto
&
path_point
:
discretized_path
.
path_points
())
{
SLPoint
sl_point
;
if
(
!
reference_line_
->
get_point_in_frenet_frame
(
Vec2d
(
path_point
.
x
(),
path_point
.
y
()),
&
sl_point
))
{
if
(
!
reference_line_
->
xy_to_sl
({
path_point
.
x
(),
path_point
.
y
()},
&
sl_point
))
{
AERROR
<<
"Fail to transfer cartesian point to frenet point."
;
return
false
;
}
...
...
modules/planning/common/path_obstacle.cc
浏览文件 @
82436ca6
...
...
@@ -72,7 +72,7 @@ bool PathObstacle::InitPerceptionSLBoundary(
obstacle_
->
PerceptionBoundingBox
().
GetAllCorners
(
&
corners
);
for
(
const
auto
&
point
:
corners
)
{
common
::
SLPoint
sl_point
;
if
(
!
reference_line
->
get_point_in_frenet_frame
(
point
,
&
sl_point
))
{
if
(
!
reference_line
->
xy_to_sl
(
point
,
&
sl_point
))
{
AERROR
<<
"failed to get projection for point: "
<<
point
.
DebugString
()
<<
" on reference line."
;
return
false
;
...
...
modules/planning/common/reference_line_info.cc
浏览文件 @
82436ca6
...
...
@@ -79,7 +79,7 @@ bool ReferenceLineInfo::InitPerceptionSLBoundary(PathObstacle* path_obstacle) {
path_obstacle
->
Obstacle
()
->
PerceptionBoundingBox
().
GetAllCorners
(
&
corners
);
for
(
const
auto
&
point
:
corners
)
{
common
::
SLPoint
sl_point
;
if
(
!
reference_line_
.
get_point_in_frenet_frame
(
point
,
&
sl_point
))
{
if
(
!
reference_line_
.
xy_to_sl
(
point
,
&
sl_point
))
{
AERROR
<<
"failed to get projection for point: "
<<
point
.
DebugString
()
<<
" on reference line."
;
return
false
;
...
...
@@ -137,7 +137,7 @@ bool ReferenceLineInfo::IsStartFrom(
const
auto
&
prev_reference_line
=
previous_reference_line_info
.
reference_line
();
common
::
SLPoint
sl_point
;
prev_reference_line
.
get_point_in_frenet_frame
(
start_point
,
&
sl_point
);
prev_reference_line
.
xy_to_sl
(
start_point
,
&
sl_point
);
return
previous_reference_line_info
.
reference_line_
.
is_on_road
(
sl_point
);
}
...
...
modules/planning/planner/em/decider.cc
浏览文件 @
82436ca6
...
...
@@ -72,8 +72,7 @@ int Decider::MakeMainStopDecision(
const
auto
&
reference_line
=
reference_line_info
.
reference_line
();
apollo
::
common
::
PointENU
stop_point
=
object_decision
.
stop
().
stop_point
();
common
::
SLPoint
stop_line_sl
;
reference_line
.
get_point_in_frenet_frame
({
stop_point
.
x
(),
stop_point
.
y
()},
&
stop_line_sl
);
reference_line
.
xy_to_sl
({
stop_point
.
x
(),
stop_point
.
y
()},
&
stop_line_sl
);
double
stop_line_s
=
stop_line_sl
.
s
();
if
(
stop_line_s
<
0
||
stop_line_s
>
reference_line
.
length
())
{
...
...
@@ -86,8 +85,7 @@ int Decider::MakeMainStopDecision(
// check stop_line_s vs adc_s
common
::
SLPoint
adc_sl
;
auto
&
adc_position
=
common
::
VehicleState
::
instance
()
->
pose
().
position
();
reference_line
.
get_point_in_frenet_frame
(
{
adc_position
.
x
(),
adc_position
.
y
()},
&
adc_sl
);
reference_line
.
xy_to_sl
({
adc_position
.
x
(),
adc_position
.
y
()},
&
adc_sl
);
const
auto
&
vehicle_param
=
common
::
VehicleConfigHelper
::
instance
()
->
GetConfig
().
vehicle_param
();
if
(
stop_line_s
<=
adc_sl
.
s
()
+
vehicle_param
.
front_edge_to_center
())
{
...
...
modules/planning/planner/em/em_planner.cc
浏览文件 @
82436ca6
...
...
@@ -190,16 +190,16 @@ std::vector<SpeedPoint> EMPlanner::GenerateInitSpeedProfile(
const
auto
&
last_init_point
=
last_frame
->
PlanningStartPoint
().
path_point
();
Vec2d
last_xy_point
(
last_init_point
.
x
(),
last_init_point
.
y
());
SLPoint
last_sl_point
;
if
(
!
last_reference_line_info
->
reference_line
().
get_point_in_frenet_frame
(
last_xy_point
,
&
last_sl_point
))
{
if
(
!
last_reference_line_info
->
reference_line
().
xy_to_sl
(
last_xy_point
,
&
last_sl_point
))
{
AERROR
<<
"Fail to transfer xy to sl when init speed profile"
;
}
Vec2d
xy_point
(
planning_init_point
.
path_point
().
x
(),
planning_init_point
.
path_point
().
y
());
SLPoint
sl_point
;
if
(
!
last_reference_line_info
->
reference_line
().
get_point_in_frenet_frame
(
xy_point
,
&
last_sl_point
))
{
if
(
!
last_reference_line_info
->
reference_line
().
xy_to_sl
(
xy_point
,
&
last_sl_point
))
{
AERROR
<<
"Fail to transfer xy to sl when init speed profile"
;
}
double
s_diff
=
sl_point
.
s
()
-
last_sl_point
.
s
();
...
...
modules/planning/reference_line/reference_line.cc
浏览文件 @
82436ca6
...
...
@@ -165,9 +165,8 @@ ReferencePoint ReferenceLine::get_reference_point(const double x,
reference_points_
[
index_end
],
s1
,
s
);
}
bool
ReferenceLine
::
get_point_in_cartesian_frame
(
const
common
::
SLPoint
&
sl_point
,
common
::
math
::
Vec2d
*
const
xy_point
)
const
{
bool
ReferenceLine
::
sl_to_xy
(
const
common
::
SLPoint
&
sl_point
,
common
::
math
::
Vec2d
*
const
xy_point
)
const
{
CHECK_NOTNULL
(
xy_point
);
if
(
map_path_
.
num_points
()
<
2
)
{
AERROR
<<
"The reference line has too few points."
;
...
...
@@ -181,9 +180,8 @@ bool ReferenceLine::get_point_in_cartesian_frame(
return
true
;
}
bool
ReferenceLine
::
get_point_in_frenet_frame
(
const
common
::
math
::
Vec2d
&
xy_point
,
common
::
SLPoint
*
const
sl_point
)
const
{
bool
ReferenceLine
::
xy_to_sl
(
const
common
::
math
::
Vec2d
&
xy_point
,
common
::
SLPoint
*
const
sl_point
)
const
{
DCHECK_NOTNULL
(
sl_point
);
double
s
=
0
;
double
l
=
0
;
...
...
@@ -292,7 +290,7 @@ double ReferenceLine::GetSpeedLimitFromS(const double s) const {
double
ReferenceLine
::
GetSpeedLimitFromPoint
(
const
common
::
math
::
Vec2d
&
point
)
const
{
SLPoint
sl
;
if
(
!
get_point_in_frenet_frame
(
point
,
&
sl
))
{
if
(
!
xy_to_sl
(
point
,
&
sl
))
{
AWARN
<<
"Failed to get projection for point: "
<<
point
.
DebugString
();
return
FLAGS_planning_speed_upper_limit
;
}
...
...
modules/planning/reference_line/reference_line.h
浏览文件 @
82436ca6
...
...
@@ -49,10 +49,10 @@ class ReferenceLine {
ReferencePoint
get_reference_point
(
const
double
s
)
const
;
ReferencePoint
get_reference_point
(
const
double
x
,
const
double
y
)
const
;
bool
get_point_in_cartesian_frame
(
const
common
::
SLPoint
&
sl_point
,
common
::
math
::
Vec2d
*
const
xy_point
)
const
;
bool
get_point_in_frenet_frame
(
const
common
::
math
::
Vec2d
&
xy_point
,
common
::
SLPoint
*
const
sl_point
)
const
;
bool
sl_to_xy
(
const
common
::
SLPoint
&
sl_point
,
common
::
math
::
Vec2d
*
const
xy_point
)
const
;
bool
xy_to_sl
(
const
common
::
math
::
Vec2d
&
xy_point
,
common
::
SLPoint
*
const
sl_point
)
const
;
bool
get_lane_width
(
const
double
s
,
double
*
const
left_width
,
double
*
const
right_width
)
const
;
...
...
modules/planning/reference_line/reference_line_smoother.cc
浏览文件 @
82436ca6
...
...
@@ -110,8 +110,7 @@ bool ReferenceLineSmoother::smooth(
}
common
::
SLPoint
ref_sl_point
;
if
(
!
raw_reference_line
.
get_point_in_frenet_frame
({
xy
.
first
,
xy
.
second
},
&
ref_sl_point
))
{
if
(
!
raw_reference_line
.
xy_to_sl
({
xy
.
first
,
xy
.
second
},
&
ref_sl_point
))
{
AERROR
<<
"get sl point failed!"
<<
std
::
endl
;
return
false
;
}
...
...
modules/planning/tasks/dp_poly_path/dp_road_graph.cc
浏览文件 @
82436ca6
...
...
@@ -57,7 +57,7 @@ bool DPRoadGraph::FindPathTunnel(const common::TrajectoryPoint &init_point,
PathData
*
const
path_data
)
{
CHECK_NOTNULL
(
path_data
);
init_point_
=
init_point
;
if
(
!
reference_line_
.
get_point_in_frenet_frame
(
if
(
!
reference_line_
.
xy_to_sl
(
{
init_point_
.
path_point
().
x
(),
init_point_
.
path_point
().
y
()},
&
init_sl_point_
))
{
AERROR
<<
"Fail to create init_sl_point from : "
...
...
@@ -192,8 +192,7 @@ bool DPRoadGraph::MakeStaticObstacleDecision(
common
::
math
::
Vec2d
{
path_point
.
x
(),
path_point
.
y
()},
path_point
.
theta
(),
adc_length
,
adc_width
);
common
::
SLPoint
adc_sl
;
if
(
!
reference_line_
.
get_point_in_frenet_frame
(
{
path_point
.
x
(),
path_point
.
y
()},
&
adc_sl
))
{
if
(
!
reference_line_
.
xy_to_sl
({
path_point
.
x
(),
path_point
.
y
()},
&
adc_sl
))
{
AERROR
<<
"get_point_in_Frenet_frame error for ego vehicle "
<<
path_point
.
x
()
<<
" "
<<
path_point
.
y
();
return
false
;
...
...
@@ -359,8 +358,7 @@ bool DPRoadGraph::ComputeBoundingBoxesForAdc(
common
::
SLPoint
sl_point
;
sl_point
.
set_s
(
s
);
sl_point
.
set_l
(
l
);
reference_line_
.
get_point_in_cartesian_frame
(
sl_point
,
&
adc_position_cartesian
);
reference_line_
.
sl_to_xy
(
sl_point
,
&
adc_position_cartesian
);
ReferencePoint
reference_point
=
reference_line_
.
get_reference_point
(
s
);
...
...
@@ -383,8 +381,7 @@ bool DPRoadGraph::SamplePathWaypoints(
common
::
math
::
Vec2d
init_cartesian_point
(
init_point
.
path_point
().
x
(),
init_point
.
path_point
().
y
());
common
::
SLPoint
init_sl_point
;
if
(
!
reference_line_
.
get_point_in_frenet_frame
(
init_cartesian_point
,
&
init_sl_point
))
{
if
(
!
reference_line_
.
xy_to_sl
(
init_cartesian_point
,
&
init_sl_point
))
{
AERROR
<<
"Failed to get sl point from point "
<<
init_cartesian_point
.
DebugString
();
return
false
;
...
...
modules/planning/tasks/qp_spline_path/qp_frenet_frame.cc
浏览文件 @
82436ca6
...
...
@@ -166,13 +166,11 @@ bool QpFrenetFrame::MapDynamicObstacleWithDecision(
obs_box
.
GetAllCorners
(
&
corners
);
std
::
vector
<
common
::
SLPoint
>
sl_corners
;
for
(
uint32_t
i
=
0
;
i
<
corners
.
size
();
++
i
)
{
for
(
const
auto
&
corner_xy
:
corners
)
{
common
::
SLPoint
cur_point
;
if
(
!
reference_line_
.
get_point_in_frenet_frame
(
{
corners
[
i
].
x
(),
corners
[
i
].
y
()},
&
cur_point
))
{
AERROR
<<
"Fail to map xy point "
<<
corners
[
i
].
DebugString
()
<<
" to "
if
(
!
reference_line_
.
xy_to_sl
(
corner_xy
,
&
cur_point
))
{
AERROR
<<
"Fail to map xy point "
<<
corner_xy
.
DebugString
()
<<
" to "
<<
cur_point
.
ShortDebugString
();
return
false
;
}
// shift box base on buffer
...
...
@@ -259,11 +257,10 @@ bool QpFrenetFrame::MapPolygon(
std
::
vector
<
std
::
pair
<
double
,
double
>>*
const
bound_map
)
{
std
::
vector
<
common
::
SLPoint
>
sl_corners
;
for
(
uint32_t
i
=
0
;
i
<
corners
.
size
();
++
i
)
{
for
(
const
auto
&
corner_xy
:
corners
)
{
common
::
SLPoint
cur_point
;
common
::
math
::
Vec2d
xy_point
(
corners
[
i
].
x
(),
corners
[
i
].
y
());
if
(
!
reference_line_
.
get_point_in_frenet_frame
(
xy_point
,
&
cur_point
))
{
AERROR
<<
"Fail to map xy point "
<<
corners
[
i
].
DebugString
()
<<
" to "
if
(
!
reference_line_
.
xy_to_sl
(
corner_xy
,
&
cur_point
))
{
AERROR
<<
"Fail to map xy point "
<<
corner_xy
.
DebugString
()
<<
" to "
<<
cur_point
.
DebugString
();
return
false
;
}
...
...
modules/planning/tasks/qp_spline_path/qp_spline_path_generator.cc
浏览文件 @
82436ca6
...
...
@@ -151,7 +151,7 @@ bool QpSplinePathGenerator::CalculateInitFrenetPoint(
const
common
::
TrajectoryPoint
&
traj_point
,
common
::
FrenetFramePoint
*
const
frenet_frame_point
)
{
common
::
SLPoint
sl_point
;
if
(
!
reference_line_
.
get_point_in_frenet_frame
(
if
(
!
reference_line_
.
xy_to_sl
(
{
traj_point
.
path_point
().
x
(),
traj_point
.
path_point
().
y
()},
&
sl_point
))
{
return
false
;
...
...
modules/planning/tasks/st_graph/st_boundary_mapper.cc
浏览文件 @
82436ca6
...
...
@@ -71,7 +71,7 @@ StBoundaryMapper::StBoundaryMapper(const StBoundaryConfig& config,
planning_time_
(
planning_time
)
{
const
auto
&
path_start_point
=
path_data_
.
discretized_path
().
StartPoint
();
common
::
SLPoint
sl_point
;
DCHECK
(
reference_line_
.
get_point_in_frenet_frame
(
DCHECK
(
reference_line_
.
xy_to_sl
(
{
path_start_point
.
x
(),
path_start_point
.
y
()},
&
sl_point
))
<<
"Failed to get adc reference line s"
;
adc_front_s_
=
sl_point
.
s
()
+
vehicle_param_
.
front_edge_to_center
();
...
...
@@ -456,9 +456,9 @@ Status StBoundaryMapper::MapFollowDecision(
const
auto
*
obstacle
=
path_obstacle
.
Obstacle
();
SLPoint
obstacle_sl_point
;
reference_line_
.
get_point_in_frenet_frame
(
Vec2d
(
obstacle
->
Perception
().
position
().
x
(),
obstacle
->
Perception
().
position
().
y
())
,
reference_line_
.
xy_to_sl
(
{
obstacle
->
Perception
().
position
().
x
(),
obstacle
->
Perception
().
position
().
y
()}
,
&
obstacle_sl_point
);
const
auto
&
ref_point
=
reference_line_
.
get_reference_point
(
...
...
@@ -477,8 +477,8 @@ Status StBoundaryMapper::MapFollowDecision(
const
auto
&
start_point
=
path_data_
.
discretized_path
().
StartPoint
();
SLPoint
start_sl_point
;
if
(
!
reference_line_
.
get_point_in_frenet_frame
(
Vec2d
(
start_point
.
x
(),
start_point
.
y
()),
&
start_sl_point
))
{
if
(
!
reference_line_
.
xy_to_sl
({
start_point
.
x
(),
start_point
.
y
()},
&
start_sl_point
))
{
std
::
string
msg
=
"Fail to get s and l of start point."
;
AERROR
<<
msg
;
return
common
::
Status
(
ErrorCode
::
PLANNING_ERROR
,
msg
);
...
...
modules/planning/tasks/traffic_decider/traffic_decider.cc
浏览文件 @
82436ca6
...
...
@@ -66,7 +66,7 @@ const Obstacle *TrafficDecider::CreateDestinationObstacle() {
// check if destination point is in planning range
common
::
SLPoint
destination_sl
;
const
auto
&
reference_line
=
reference_line_info_
->
reference_line
();
reference_line
.
get_point_in_frenet_frame
(
destination
,
&
destination_sl
);
reference_line
.
xy_to_sl
(
destination
,
&
destination_sl
);
double
destination_s
=
destination_sl
.
s
();
if
(
destination_s
<
0
||
destination_s
>
reference_line
.
length
())
{
AINFO
<<
"destination(s[:"
<<
destination_sl
.
s
()
...
...
@@ -77,8 +77,7 @@ const Obstacle *TrafficDecider::CreateDestinationObstacle() {
// adjust destination based on adc_front_s
common
::
SLPoint
adc_sl
;
auto
&
adc_position
=
VehicleState
::
instance
()
->
pose
().
position
();
reference_line
.
get_point_in_frenet_frame
({
adc_position
.
x
(),
adc_position
.
y
()},
&
adc_sl
);
reference_line
.
xy_to_sl
({
adc_position
.
x
(),
adc_position
.
y
()},
&
adc_sl
);
const
auto
&
vehicle_param
=
VehicleConfigHelper
::
instance
()
->
GetConfig
().
vehicle_param
();
double
adc_front_s
=
adc_sl
.
s
()
+
vehicle_param
.
front_edge_to_center
();
...
...
@@ -124,7 +123,7 @@ bool TrafficDecider::MakeDestinationStopDecision() {
// check stop_posision on reference line
auto
stop_position
=
obstacle
->
Perception
().
position
();
common
::
SLPoint
stop_line_sl
;
reference_line
.
get_point_in_frenet_frame
(
reference_line
.
xy_to_sl
(
{
stop_position
.
x
(),
stop_position
.
y
()},
&
stop_line_sl
);
if
(
!
reference_line
.
is_on_road
(
stop_line_sl
))
{
return
false
;
...
...
@@ -133,8 +132,7 @@ bool TrafficDecider::MakeDestinationStopDecision() {
// check stop_line_s vs adc_s. stop_line_s must be ahead of adc_front_s
common
::
SLPoint
adc_sl
;
auto
&
adc_position
=
VehicleState
::
instance
()
->
pose
().
position
();
reference_line
.
get_point_in_frenet_frame
({
adc_position
.
x
(),
adc_position
.
y
()},
&
adc_sl
);
reference_line
.
xy_to_sl
({
adc_position
.
x
(),
adc_position
.
y
()},
&
adc_sl
);
const
auto
&
vehicle_param
=
VehicleConfigHelper
::
instance
()
->
GetConfig
().
vehicle_param
();
double
adc_front_s
=
adc_sl
.
s
()
+
vehicle_param
.
front_edge_to_center
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录