Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
60116165
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,发现更多精彩内容 >>
提交
60116165
编写于
11月 19, 2019
作者:
X
Xiangquan Xiao
提交者:
Jiangtao Hu
11月 20, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Common: Migrate MakeSLPoint to PointFactory.
上级
af76fe2e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
18 addition
and
23 deletion
+18
-23
modules/common/util/BUILD
modules/common/util/BUILD
+1
-0
modules/common/util/point_factory.h
modules/common/util/point_factory.h
+8
-0
modules/common/util/util.cc
modules/common/util/util.cc
+0
-7
modules/common/util/util.h
modules/common/util/util.h
+0
-10
modules/planning/tasks/optimizers/road_graph/trajectory_cost.cc
...s/planning/tasks/optimizers/road_graph/trajectory_cost.cc
+2
-2
modules/planning/tasks/optimizers/road_graph/waypoint_sampler.cc
.../planning/tasks/optimizers/road_graph/waypoint_sampler.cc
+3
-1
modules/planning/traffic_rules/change_lane.cc
modules/planning/traffic_rules/change_lane.cc
+4
-3
未找到文件。
modules/common/util/BUILD
浏览文件 @
60116165
...
...
@@ -32,6 +32,7 @@ cc_library(
hdrs
=
[
"point_factory.h"
],
deps
=
[
"//modules/common/math:geometry"
,
"//modules/common/proto:pnc_point_proto"
,
],
)
...
...
modules/common/util/point_factory.h
浏览文件 @
60116165
...
...
@@ -17,6 +17,7 @@
#pragma once
#include "modules/common/math/vec2d.h"
#include "modules/common/proto/pnc_point.pb.h"
namespace
apollo
{
namespace
common
{
...
...
@@ -28,6 +29,13 @@ class PointFactory {
static
inline
math
::
Vec2d
ToVec2d
(
const
XY
&
xy
)
{
return
math
::
Vec2d
(
xy
.
x
(),
xy
.
y
());
}
static
inline
SLPoint
ToSLPoint
(
const
double
s
,
const
double
l
)
{
SLPoint
sl
;
sl
.
set_s
(
s
);
sl
.
set_l
(
l
);
return
sl
;
}
};
}
// namespace util
...
...
modules/common/util/util.cc
浏览文件 @
60116165
...
...
@@ -23,13 +23,6 @@ namespace apollo {
namespace
common
{
namespace
util
{
SLPoint
MakeSLPoint
(
const
double
s
,
const
double
l
)
{
SLPoint
sl
;
sl
.
set_s
(
s
);
sl
.
set_l
(
l
);
return
sl
;
}
PointENU
MakePointENU
(
const
double
x
,
const
double
y
,
const
double
z
)
{
PointENU
point_enu
;
point_enu
.
set_x
(
x
);
...
...
modules/common/util/util.h
浏览文件 @
60116165
...
...
@@ -30,8 +30,6 @@
#include <vector>
#include "absl/memory/memory.h"
#include "google/protobuf/util/message_differencer.h"
#include "cyber/common/log.h"
#include "cyber/common/types.h"
#include "modules/common/math/vec2d.h"
...
...
@@ -76,14 +74,6 @@ bool WithinBound(T start, T end, T value) {
return
value
>=
start
&&
value
<=
end
;
}
/**
* @brief create a SL point
* @param s the s value
* @param l the l value
* @return a SLPoint instance
*/
SLPoint
MakeSLPoint
(
const
double
s
,
const
double
l
);
PointENU
MakePointENU
(
const
double
x
,
const
double
y
,
const
double
z
);
PointENU
operator
+
(
const
PointENU
enu
,
const
math
::
Vec2d
&
xy
);
...
...
modules/planning/tasks/optimizers/road_graph/trajectory_cost.cc
浏览文件 @
60116165
...
...
@@ -27,7 +27,7 @@
#include "modules/common/configs/vehicle_config_helper.h"
#include "modules/common/math/vec2d.h"
#include "modules/common/util/
util
.h"
#include "modules/common/util/
point_factory
.h"
#include "modules/planning/common/planning_gflags.h"
namespace
apollo
{
...
...
@@ -227,7 +227,7 @@ ComparableCost TrajectoryCost::CalculateDynamicObstacleCost(
const
double
l
=
curve
.
Evaluate
(
0
,
s
);
const
double
dl
=
curve
.
Evaluate
(
1
,
s
);
const
common
::
SLPoint
sl
=
common
::
util
::
Make
SLPoint
(
ref_s
,
l
);
const
common
::
SLPoint
sl
=
common
::
util
::
PointFactory
::
To
SLPoint
(
ref_s
,
l
);
const
Box2d
ego_box
=
GetBoxFromSLPoint
(
sl
,
dl
);
for
(
const
auto
&
obstacle_trajectory
:
dynamic_obstacle_boxes_
)
{
obstacle_cost
+=
...
...
modules/planning/tasks/optimizers/road_graph/waypoint_sampler.cc
浏览文件 @
60116165
...
...
@@ -25,6 +25,7 @@
#include "cyber/common/log.h"
#include "modules/common/configs/vehicle_config_helper.h"
#include "modules/common/math/cartesian_frenet_conversion.h"
#include "modules/common/util/point_factory.h"
#include "modules/common/util/util.h"
#include "modules/map/hdmap/hdmap_util.h"
#include "modules/planning/common/ego_info.h"
...
...
@@ -141,7 +142,8 @@ bool WaypointSampler::SamplePathWaypoints(
std
::
vector
<
common
::
SLPoint
>
level_points
;
planning_internal
::
SampleLayerDebug
sample_layer_debug
;
for
(
size_t
j
=
0
;
j
<
sample_l
.
size
();
++
j
)
{
common
::
SLPoint
sl
=
common
::
util
::
MakeSLPoint
(
s
,
sample_l
[
j
]);
common
::
SLPoint
sl
=
common
::
util
::
PointFactory
::
ToSLPoint
(
s
,
sample_l
[
j
]);
sample_layer_debug
.
add_sl_point
()
->
CopyFrom
(
sl
);
level_points
.
push_back
(
std
::
move
(
sl
));
}
...
...
modules/planning/traffic_rules/change_lane.cc
浏览文件 @
60116165
...
...
@@ -22,7 +22,7 @@
#include <algorithm>
#include "modules/common/util/
util
.h"
#include "modules/common/util/
point_factory
.h"
namespace
apollo
{
namespace
planning
{
...
...
@@ -107,8 +107,9 @@ bool ChangeLane::CreateGuardObstacle(
auto
ref_point
=
reference_line
.
GetNearestReferencePoint
(
ref_s
);
Vec2d
xy_point
;
if
(
!
reference_line
.
SLToXY
(
common
::
util
::
MakeSLPoint
(
ref_s
,
sl_point
.
l
()),
&
xy_point
))
{
if
(
!
reference_line
.
SLToXY
(
common
::
util
::
PointFactory
::
ToSLPoint
(
ref_s
,
sl_point
.
l
()),
&
xy_point
))
{
return
false
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录