Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
4f6c4283
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,发现更多精彩内容 >>
提交
4f6c4283
编写于
8月 08, 2017
作者:
Z
Zhang Liangliang
提交者:
Jiangtao Hu
8月 08, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Planning: restructured path_data. TODO: transfer discretized path to frenet path when set.
上级
307fb6d1
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
68 addition
and
60 deletion
+68
-60
modules/planning/common/path/BUILD
modules/planning/common/path/BUILD
+1
-0
modules/planning/common/path/discretized_path.h
modules/planning/common/path/discretized_path.h
+1
-1
modules/planning/common/path/path_data.cc
modules/planning/common/path/path_data.cc
+58
-1
modules/planning/common/path/path_data.h
modules/planning/common/path/path_data.h
+8
-1
modules/planning/optimizer/dp_poly_path/BUILD
modules/planning/optimizer/dp_poly_path/BUILD
+0
-1
modules/planning/optimizer/dp_poly_path/dp_road_graph.cc
modules/planning/optimizer/dp_poly_path/dp_road_graph.cc
+0
-53
modules/planning/optimizer/dp_poly_path/dp_road_graph.h
modules/planning/optimizer/dp_poly_path/dp_road_graph.h
+0
-3
未找到文件。
modules/planning/common/path/BUILD
浏览文件 @
4f6c4283
...
...
@@ -43,6 +43,7 @@ cc_library(
":frenet_frame_path"
,
"//modules/planning/common:planning_gflags"
,
"//modules/planning/math:double"
,
"//modules/planning/math:sl_analytic_transformation"
,
"//modules/planning/reference_line"
,
],
)
...
...
modules/planning/common/path/discretized_path.h
浏览文件 @
4f6c4283
...
...
@@ -68,4 +68,4 @@ class DiscretizedPath {
}
// namespace planning
}
// namespace apollo
#endif
/* MODULES_PLANNING_COMMON_PATH_PATH_H_ */
#endif
// MODULES_PLANNING_COMMON_PATH_PATH_H_
modules/planning/common/path/path_data.cc
浏览文件 @
4f6c4283
...
...
@@ -28,6 +28,7 @@
#include "modules/planning/common/planning_gflags.h"
#include "modules/planning/common/planning_util.h"
#include "modules/planning/math/double.h"
#include "modules/planning/math/sl_analytic_transformation.h"
namespace
apollo
{
namespace
planning
{
...
...
@@ -39,8 +40,18 @@ void PathData::set_discretized_path(const DiscretizedPath &path) {
discretized_path_
=
path
;
}
void
PathData
::
set_frenet_path
(
const
FrenetFramePath
&
frenet_path
)
{
bool
PathData
::
set_frenet_path
(
const
FrenetFramePath
&
frenet_path
)
{
if
(
reference_line_
==
nullptr
)
{
AERROR
<<
"Should NOT set frenet path with reference line is nullptr. "
"Please set reference line first."
;
return
false
;
}
frenet_path_
=
frenet_path
;
if
(
!
FrenetToCartesian
(
frenet_path_
,
&
discretized_path_
))
{
AERROR
<<
"Fail to transfer frenet path to discretized path."
;
return
false
;
}
return
true
;
}
void
PathData
::
set_discretized_path
(
...
...
@@ -57,6 +68,7 @@ const FrenetFramePath &PathData::frenet_frame_path() const {
}
void
PathData
::
set_reference_line
(
const
ReferenceLine
*
reference_line
)
{
// Clear();
reference_line_
=
reference_line
;
}
...
...
@@ -112,5 +124,50 @@ std::string PathData::DebugString() const {
"]
\n
"
);
}
bool
PathData
::
FrenetToCartesian
(
const
FrenetFramePath
&
frenet_path
,
DiscretizedPath
*
const
discretized_path
)
{
DCHECK_NOTNULL
(
discretized_path
);
std
::
vector
<
common
::
PathPoint
>
path_points
;
for
(
const
common
::
FrenetFramePoint
&
frenet_point
:
frenet_path
.
points
())
{
common
::
SLPoint
sl_point
;
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
))
{
AERROR
<<
"Fail to convert sl point to xy point"
;
return
false
;
}
ReferencePoint
ref_point
=
reference_line_
->
get_reference_point
(
frenet_point
.
s
());
double
theta
=
SLAnalyticTransformation
::
calculate_theta
(
ref_point
.
heading
(),
ref_point
.
kappa
(),
frenet_point
.
l
(),
frenet_point
.
dl
());
double
kappa
=
SLAnalyticTransformation
::
calculate_kappa
(
ref_point
.
kappa
(),
ref_point
.
dkappa
(),
frenet_point
.
l
(),
frenet_point
.
dl
(),
frenet_point
.
ddl
());
common
::
PathPoint
path_point
;
path_point
.
set_x
(
cartesian_point
.
x
());
path_point
.
set_y
(
cartesian_point
.
y
());
path_point
.
set_z
(
0.0
);
path_point
.
set_theta
(
theta
);
path_point
.
set_kappa
(
kappa
);
path_point
.
set_dkappa
(
0.0
);
path_point
.
set_ddkappa
(
0.0
);
path_point
.
set_s
(
0.0
);
if
(
!
path_points
.
empty
())
{
common
::
math
::
Vec2d
last
(
path_points
.
back
().
x
(),
path_points
.
back
().
y
());
common
::
math
::
Vec2d
current
(
path_point
.
x
(),
path_point
.
y
());
double
distance
=
(
last
-
current
).
Length
();
path_point
.
set_s
(
path_points
.
back
().
s
()
+
distance
);
}
path_points
.
push_back
(
std
::
move
(
path_point
));
}
*
discretized_path
=
DiscretizedPath
(
path_points
);
return
true
;
}
}
// namespace planning
}
// namespace apollo
modules/planning/common/path/path_data.h
浏览文件 @
4f6c4283
...
...
@@ -38,7 +38,7 @@ class PathData {
void
set_discretized_path
(
const
std
::
vector
<
common
::
PathPoint
>
&
path_points
);
void
set_frenet_path
(
const
FrenetFramePath
&
frenet_path
);
bool
set_frenet_path
(
const
FrenetFramePath
&
frenet_path
);
void
set_reference_line
(
const
ReferenceLine
*
reference_line
);
...
...
@@ -61,6 +61,13 @@ class PathData {
std
::
string
DebugString
()
const
;
private:
/*
* convert frenet path to cartesian path by reference line
*/
bool
FrenetToCartesian
(
const
FrenetFramePath
&
frenet_path
,
DiscretizedPath
*
const
discretized_path
);
bool
CartesianToFrenet
(
const
DiscretizedPath
&
discretized_path
,
FrenetFramePath
*
const
frenet_path
);
const
ReferenceLine
*
reference_line_
=
nullptr
;
DiscretizedPath
discretized_path_
;
FrenetFramePath
frenet_path_
;
...
...
modules/planning/optimizer/dp_poly_path/BUILD
浏览文件 @
4f6c4283
...
...
@@ -23,7 +23,6 @@ cc_library(
"//modules/planning/common:planning_gflags"
,
"//modules/planning/common/path:path_data"
,
"//modules/planning/common/speed:speed_data"
,
"//modules/planning/math:sl_analytic_transformation"
,
"//modules/planning/math/curve1d:polynomial_curve1d"
,
"//modules/planning/math/curve1d:quintic_polynomial_curve1d"
,
"//modules/planning/proto:dp_poly_path_config_proto"
,
...
...
modules/planning/optimizer/dp_poly_path/dp_road_graph.cc
浏览文件 @
4f6c4283
...
...
@@ -36,7 +36,6 @@
#include "modules/planning/common/planning_gflags.h"
#include "modules/planning/math/curve1d/quintic_polynomial_curve1d.h"
#include "modules/planning/math/double.h"
#include "modules/planning/math/sl_analytic_transformation.h"
#include "modules/planning/optimizer/dp_poly_path/trajectory_cost.h"
namespace
apollo
{
...
...
@@ -97,60 +96,8 @@ bool DPRoadGraph::FindPathTunnel(const common::TrajectoryPoint &init_point,
}
FrenetFramePath
tunnel
(
frenet_path
);
DiscretizedPath
discretized_path
;
if
(
!
FrenetToCartesian
(
tunnel
,
&
discretized_path
))
{
AERROR
<<
"Failed to convert dp graph tunnel to PathData"
;
return
false
;
}
path_data
->
set_reference_line
(
&
reference_line_
);
path_data
->
set_frenet_path
(
tunnel
);
path_data
->
set_discretized_path
(
discretized_path
);
return
true
;
}
bool
DPRoadGraph
::
FrenetToCartesian
(
const
FrenetFramePath
&
frenet_path
,
DiscretizedPath
*
const
discretized_path
)
{
DCHECK_NOTNULL
(
discretized_path
);
// convert frenet path to cartesian path by reference line
std
::
vector
<
common
::
PathPoint
>
path_points
;
for
(
const
common
::
FrenetFramePoint
&
frenet_point
:
frenet_path
.
points
())
{
common
::
SLPoint
sl_point
;
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
))
{
AERROR
<<
"Fail to convert sl point to xy point"
;
return
false
;
}
ReferencePoint
ref_point
=
reference_line_
.
get_reference_point
(
frenet_point
.
s
());
double
theta
=
SLAnalyticTransformation
::
calculate_theta
(
ref_point
.
heading
(),
ref_point
.
kappa
(),
frenet_point
.
l
(),
frenet_point
.
dl
());
double
kappa
=
SLAnalyticTransformation
::
calculate_kappa
(
ref_point
.
kappa
(),
ref_point
.
dkappa
(),
frenet_point
.
l
(),
frenet_point
.
dl
(),
frenet_point
.
ddl
());
common
::
PathPoint
path_point
;
path_point
.
set_x
(
cartesian_point
.
x
());
path_point
.
set_y
(
cartesian_point
.
y
());
path_point
.
set_z
(
0.0
);
path_point
.
set_theta
(
theta
);
path_point
.
set_kappa
(
kappa
);
path_point
.
set_dkappa
(
0.0
);
path_point
.
set_ddkappa
(
0.0
);
path_point
.
set_s
(
0.0
);
if
(
!
path_points
.
empty
())
{
common
::
math
::
Vec2d
last
(
path_points
.
back
().
x
(),
path_points
.
back
().
y
());
common
::
math
::
Vec2d
current
(
path_point
.
x
(),
path_point
.
y
());
double
distance
=
(
last
-
current
).
Length
();
path_point
.
set_s
(
path_points
.
back
().
s
()
+
distance
);
}
path_points
.
push_back
(
std
::
move
(
path_point
));
}
*
discretized_path
=
DiscretizedPath
(
path_points
);
return
true
;
}
...
...
modules/planning/optimizer/dp_poly_path/dp_road_graph.h
浏览文件 @
4f6c4283
...
...
@@ -107,9 +107,6 @@ class DPRoadGraph {
const
std
::
vector
<
const
PathObstacle
*>
&
path_obstacles
,
std
::
vector
<
std
::
pair
<
std
::
string
,
ObjectDecisionType
>>
*
const
decisions
);
bool
FrenetToCartesian
(
const
FrenetFramePath
&
frenet_path
,
DiscretizedPath
*
const
discretized_path
);
private:
DpPolyPathConfig
config_
;
common
::
TrajectoryPoint
init_point_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录