Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
9cef18bc
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,发现更多精彩内容 >>
提交
9cef18bc
编写于
7月 20, 2017
作者:
Z
Zhang Liangliang
提交者:
Calvin Miao
7月 20, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
trajectory --> path, moved to modules/common
上级
af39e230
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
165 addition
and
179 deletion
+165
-179
modules/common/path/BUILD
modules/common/path/BUILD
+3
-3
modules/common/path/path.cc
modules/common/path/path.cc
+91
-99
modules/common/path/path.h
modules/common/path/path.h
+71
-77
未找到文件。
modules/
map/pnc_map
/BUILD
→
modules/
common/path
/BUILD
浏览文件 @
9cef18bc
...
...
@@ -3,12 +3,12 @@ load("//tools:cpplint.bzl", "cpplint")
package
(
default_visibility
=
[
"//visibility:public"
])
cc_library
(
name
=
"pnc_
trajectory
"
,
name
=
"pnc_
path
"
,
srcs
=
[
"
trajectory
.cc"
,
"
path
.cc"
,
],
hdrs
=
[
"
trajectory
.h"
,
"
path
.h"
,
],
deps
=
[
"//modules/map/proto:map_proto"
,
...
...
modules/
map/pnc_map/trajectory
.cc
→
modules/
common/path/path
.cc
浏览文件 @
9cef18bc
此差异已折叠。
点击以展开。
modules/
map/pnc_map/trajectory
.h
→
modules/
common/path/path
.h
浏览文件 @
9cef18bc
...
...
@@ -34,20 +34,18 @@
#include "modules/common/math/vec2d.h"
#include "modules/map/hdmap/hdmap.h"
#include "modules/map/hdmap/hdmap_common.h"
//#include "modules/map/pnc_map/pnc_map.h"
namespace
apollo
{
namespace
hdmap
{
namespace
pnc_map
{
namespace
common
{
// class LaneInfo;
// class OverlapInfo;
struct
LaneWaypoint
{
LaneWaypoint
()
=
default
;
LaneWaypoint
(
const
LaneInfo
*
lane
,
const
double
s
)
LaneWaypoint
(
const
apollo
::
hdmap
::
LaneInfo
*
lane
,
const
double
s
)
:
lane
(
CHECK_NOTNULL
(
lane
)),
s
(
s
)
{}
const
LaneInfo
*
lane
=
nullptr
;
const
apollo
::
hdmap
::
LaneInfo
*
lane
=
nullptr
;
double
s
=
0.0
;
std
::
string
debug_string
()
const
;
...
...
@@ -55,19 +53,19 @@ struct LaneWaypoint {
struct
LaneSegment
{
LaneSegment
()
=
default
;
LaneSegment
(
const
LaneInfo
*
lane
,
const
double
start_s
,
const
double
end_s
)
LaneSegment
(
const
apollo
::
hdmap
::
LaneInfo
*
lane
,
const
double
start_s
,
const
double
end_s
)
:
lane
(
CHECK_NOTNULL
(
lane
)),
start_s
(
start_s
),
end_s
(
end_s
)
{}
const
LaneInfo
*
lane
=
nullptr
;
const
apollo
::
hdmap
::
LaneInfo
*
lane
=
nullptr
;
double
start_s
=
0.0
;
double
end_s
=
0.0
;
std
::
string
debug_string
()
const
;
};
struct
TrajectoryOverlap
{
TrajectoryOverlap
()
=
default
;
TrajectoryOverlap
(
std
::
string
object_id
,
const
double
start_s
,
const
double
end_s
)
struct
PathOverlap
{
PathOverlap
()
=
default
;
PathOverlap
(
std
::
string
object_id
,
const
double
start_s
,
const
double
end_s
)
:
object_id
(
std
::
move
(
object_id
)),
start_s
(
start_s
),
end_s
(
end_s
)
{}
std
::
string
object_id
;
...
...
@@ -77,18 +75,18 @@ struct TrajectoryOverlap {
std
::
string
debug_string
()
const
;
};
class
Trajectory
Point
:
public
apollo
::
common
::
math
::
Vec2d
{
class
Path
Point
:
public
apollo
::
common
::
math
::
Vec2d
{
public:
Trajectory
Point
()
=
default
;
Trajectory
Point
(
const
apollo
::
common
::
math
::
Vec2d
&
point
,
double
heading
)
Path
Point
()
=
default
;
Path
Point
(
const
apollo
::
common
::
math
::
Vec2d
&
point
,
double
heading
)
:
Vec2d
(
point
.
x
(),
point
.
y
()),
_heading
(
heading
)
{}
Trajectory
Point
(
const
apollo
::
common
::
math
::
Vec2d
&
point
,
double
heading
,
LaneWaypoint
lane_waypoint
)
Path
Point
(
const
apollo
::
common
::
math
::
Vec2d
&
point
,
double
heading
,
LaneWaypoint
lane_waypoint
)
:
Vec2d
(
point
.
x
(),
point
.
y
()),
_heading
(
heading
)
{
_lane_waypoints
.
emplace_back
(
std
::
move
(
lane_waypoint
));
}
Trajectory
Point
(
const
apollo
::
common
::
math
::
Vec2d
&
point
,
double
heading
,
std
::
vector
<
LaneWaypoint
>
lane_waypoints
)
Path
Point
(
const
apollo
::
common
::
math
::
Vec2d
&
point
,
double
heading
,
std
::
vector
<
LaneWaypoint
>
lane_waypoints
)
:
Vec2d
(
point
.
x
(),
point
.
y
()),
_heading
(
heading
),
_lane_waypoints
(
std
::
move
(
lane_waypoints
))
{}
...
...
@@ -119,13 +117,13 @@ class TrajectoryPoint : public apollo::common::math::Vec2d {
std
::
vector
<
LaneWaypoint
>
_lane_waypoints
;
};
class
Trajectory
;
class
Path
;
class
Trajectory
Approximation
{
class
Path
Approximation
{
public:
TrajectoryApproximation
(
const
Trajectory
&
trajectory
,
const
double
max_error
)
PathApproximation
(
const
Path
&
path
,
const
double
max_error
)
:
_max_error
(
max_error
),
_max_sqr_error
(
max_error
*
max_error
)
{
init
(
trajectory
);
init
(
path
);
}
double
max_error
()
const
{
return
_max_error
;
}
const
std
::
vector
<
int
>&
original_ids
()
const
{
return
_original_ids
;
}
...
...
@@ -133,23 +131,21 @@ class TrajectoryApproximation {
return
_segments
;
}
bool
get_projection
(
const
Trajectory
&
trajectory
,
bool
get_projection
(
const
Path
&
path
,
const
apollo
::
common
::
math
::
Vec2d
&
point
,
double
*
accumulate_s
,
double
*
lateral
,
double
*
distance
)
const
;
bool
overlap_with
(
const
Trajectory
&
trajectory
,
const
apollo
::
common
::
math
::
Box2d
&
box
,
double
width
)
const
;
bool
overlap_with
(
const
Path
&
path
,
const
apollo
::
common
::
math
::
Box2d
&
box
,
double
width
)
const
;
protected:
void
init
(
const
Trajectory
&
trajectory
);
bool
is_within_max_error
(
const
Trajectory
&
trajectory
,
const
int
s
,
const
int
t
);
double
compute_max_error
(
const
Trajectory
&
trajectory
,
const
int
s
,
const
int
t
);
void
init
(
const
Path
&
path
);
bool
is_within_max_error
(
const
Path
&
path
,
const
int
s
,
const
int
t
);
double
compute_max_error
(
const
Path
&
path
,
const
int
s
,
const
int
t
);
void
init_dilute
(
const
Trajectory
&
trajectory
);
void
init_projections
(
const
Trajectory
&
trajectory
);
void
init_dilute
(
const
Path
&
path
);
void
init_projections
(
const
Path
&
path
);
protected:
const
double
_max_error
;
...
...
@@ -184,25 +180,25 @@ class InterpolatedIndex {
double
offset
=
0.0
;
};
class
Trajectory
{
class
Path
{
public:
Trajectory
()
=
default
;
Path
()
=
default
;
Trajectory
(
const
Trajectory
&
rhs
)
=
delete
;
Trajectory
&
operator
=
(
const
Trajectory
&
rhs
)
=
delete
;
Trajectory
(
Trajectory
&&
)
=
default
;
Trajectory
&
operator
=
(
Trajectory
&&
)
=
default
;
Path
(
const
Path
&
rhs
)
=
delete
;
Path
&
operator
=
(
const
Path
&
rhs
)
=
delete
;
Path
(
Path
&&
)
=
default
;
Path
&
operator
=
(
Path
&&
)
=
default
;
Trajectory
(
std
::
vector
<
TrajectoryPoint
>
trajectory
_points
);
Trajectory
(
std
::
vector
<
TrajectoryPoint
>
trajectory
_points
,
std
::
vector
<
LaneSegment
>
lane_segments
);
Trajectory
(
std
::
vector
<
TrajectoryPoint
>
trajectory
_points
,
std
::
vector
<
LaneSegment
>
lane_segments
,
const
double
max_approximation_error
);
Path
(
std
::
vector
<
PathPoint
>
path
_points
);
Path
(
std
::
vector
<
PathPoint
>
path
_points
,
std
::
vector
<
LaneSegment
>
lane_segments
);
Path
(
std
::
vector
<
PathPoint
>
path
_points
,
std
::
vector
<
LaneSegment
>
lane_segments
,
const
double
max_approximation_error
);
// Return smooth coordinate by interpolated index or accumulate_s.
Trajectory
Point
get_smooth_point
(
const
InterpolatedIndex
&
index
)
const
;
Trajectory
Point
get_smooth_point
(
double
s
)
const
;
Path
Point
get_smooth_point
(
const
InterpolatedIndex
&
index
)
const
;
Path
Point
get_smooth_point
(
double
s
)
const
;
// Compute accumulate s value of the index.
double
get_s_from_index
(
const
InterpolatedIndex
&
index
)
const
;
...
...
@@ -220,14 +216,12 @@ class Trajectory {
double
*
accumulate_s
,
double
*
lateral
,
double
*
distance
)
const
;
bool
get_heading_along_
trajectory
(
const
apollo
::
common
::
math
::
Vec2d
&
point
,
double
*
heading
)
const
;
bool
get_heading_along_
path
(
const
apollo
::
common
::
math
::
Vec2d
&
point
,
double
*
heading
)
const
;
int
num_points
()
const
{
return
_num_points
;
}
int
num_segments
()
const
{
return
_num_segments
;
}
const
std
::
vector
<
TrajectoryPoint
>&
trajectory_points
()
const
{
return
_trajectory_points
;
}
const
std
::
vector
<
PathPoint
>&
path_points
()
const
{
return
_path_points
;
}
const
std
::
vector
<
LaneSegment
>&
lane_segments
()
const
{
return
_lane_segments
;
}
...
...
@@ -241,33 +235,33 @@ class Trajectory {
const
std
::
vector
<
apollo
::
common
::
math
::
LineSegment2d
>&
segments
()
const
{
return
_segments
;
}
const
Trajectory
Approximation
*
approximation
()
const
{
const
Path
Approximation
*
approximation
()
const
{
return
_approximation
.
get
();
}
double
length
()
const
{
return
_length
;
}
const
std
::
vector
<
Trajectory
Overlap
>&
lane_overlaps
()
const
{
const
std
::
vector
<
Path
Overlap
>&
lane_overlaps
()
const
{
return
_lane_overlaps
;
}
const
std
::
vector
<
Trajectory
Overlap
>&
signal_overlaps
()
const
{
const
std
::
vector
<
Path
Overlap
>&
signal_overlaps
()
const
{
return
_signal_overlaps
;
}
const
std
::
vector
<
Trajectory
Overlap
>&
yield_sign_overlaps
()
const
{
const
std
::
vector
<
Path
Overlap
>&
yield_sign_overlaps
()
const
{
return
_yield_sign_overlaps
;
}
const
std
::
vector
<
Trajectory
Overlap
>&
stop_sign_overlaps
()
const
{
const
std
::
vector
<
Path
Overlap
>&
stop_sign_overlaps
()
const
{
return
_stop_sign_overlaps
;
}
const
std
::
vector
<
Trajectory
Overlap
>&
crosswalk_overlaps
()
const
{
const
std
::
vector
<
Path
Overlap
>&
crosswalk_overlaps
()
const
{
return
_crosswalk_overlaps
;
}
const
std
::
vector
<
Trajectory
Overlap
>&
parking_space_overlaps
()
const
{
const
std
::
vector
<
Path
Overlap
>&
parking_space_overlaps
()
const
{
return
_parking_space_overlaps
;
}
const
std
::
vector
<
Trajectory
Overlap
>&
junction_overlaps
()
const
{
const
std
::
vector
<
Path
Overlap
>&
junction_overlaps
()
const
{
return
_junction_overlaps
;
}
const
std
::
vector
<
Trajectory
Overlap
>&
speed_bump_overlaps
()
const
{
const
std
::
vector
<
Path
Overlap
>&
speed_bump_overlaps
()
const
{
return
_speed_bump_overlaps
;
}
...
...
@@ -275,9 +269,9 @@ class Trajectory {
double
get_right_width
(
const
double
s
)
const
;
bool
get_width
(
const
double
s
,
double
*
left_width
,
double
*
right_width
)
const
;
bool
is_on_
trajectory
(
const
apollo
::
common
::
math
::
Vec2d
&
point
)
const
;
// requires all corners of the box on
trajectory
.
bool
is_on_
trajectory
(
const
apollo
::
common
::
math
::
Box2d
&
box
)
const
;
bool
is_on_
path
(
const
apollo
::
common
::
math
::
Vec2d
&
point
)
const
;
// requires all corners of the box on
path
.
bool
is_on_
path
(
const
apollo
::
common
::
math
::
Box2d
&
box
)
const
;
bool
overlap_with
(
const
apollo
::
common
::
math
::
Box2d
&
box
,
double
width
)
const
;
std
::
string
debug_string
()
const
;
...
...
@@ -293,21 +287,22 @@ class Trajectory {
double
get_sample
(
const
std
::
vector
<
double
>&
samples
,
const
double
s
)
const
;
using
GetOverlapFromLaneFunc
=
std
::
function
<
const
std
::
vector
<
const
OverlapInfo
*>&
(
const
LaneInfo
&
)
>
;
std
::
function
<
const
std
::
vector
<
const
apollo
::
hdmap
::
OverlapInfo
*>&
(
const
apollo
::
hdmap
::
LaneInfo
&
)
>
;
void
get_all_overlaps
(
GetOverlapFromLaneFunc
get_overlaps_from_lane
,
std
::
vector
<
Trajectory
Overlap
>*
const
overlaps
)
const
;
std
::
vector
<
Path
Overlap
>*
const
overlaps
)
const
;
protected:
int
_num_points
=
0
;
int
_num_segments
=
0
;
std
::
vector
<
TrajectoryPoint
>
_trajectory
_points
;
std
::
vector
<
PathPoint
>
_path
_points
;
std
::
vector
<
LaneSegment
>
_lane_segments
;
std
::
vector
<
LaneSegment
>
_lane_segments_to_next_point
;
std
::
vector
<
apollo
::
common
::
math
::
Vec2d
>
_unit_directions
;
double
_length
=
0.0
;
std
::
vector
<
double
>
_accumulated_s
;
std
::
vector
<
apollo
::
common
::
math
::
LineSegment2d
>
_segments
;
std
::
unique_ptr
<
Trajectory
Approximation
>
_approximation
;
std
::
unique_ptr
<
Path
Approximation
>
_approximation
;
// Sampled every fixed length.
int
_num_sample_points
=
0
;
...
...
@@ -315,18 +310,17 @@ class Trajectory {
std
::
vector
<
double
>
_right_width
;
std
::
vector
<
int
>
_last_point_index
;
std
::
vector
<
Trajectory
Overlap
>
_lane_overlaps
;
std
::
vector
<
Trajectory
Overlap
>
_signal_overlaps
;
std
::
vector
<
Trajectory
Overlap
>
_yield_sign_overlaps
;
std
::
vector
<
Trajectory
Overlap
>
_stop_sign_overlaps
;
std
::
vector
<
Trajectory
Overlap
>
_crosswalk_overlaps
;
std
::
vector
<
Trajectory
Overlap
>
_parking_space_overlaps
;
std
::
vector
<
Trajectory
Overlap
>
_junction_overlaps
;
std
::
vector
<
Trajectory
Overlap
>
_speed_bump_overlaps
;
std
::
vector
<
Path
Overlap
>
_lane_overlaps
;
std
::
vector
<
Path
Overlap
>
_signal_overlaps
;
std
::
vector
<
Path
Overlap
>
_yield_sign_overlaps
;
std
::
vector
<
Path
Overlap
>
_stop_sign_overlaps
;
std
::
vector
<
Path
Overlap
>
_crosswalk_overlaps
;
std
::
vector
<
Path
Overlap
>
_parking_space_overlaps
;
std
::
vector
<
Path
Overlap
>
_junction_overlaps
;
std
::
vector
<
Path
Overlap
>
_speed_bump_overlaps
;
};
}
// namespace pnc_map
}
// namespace hdmap
}
// namespace common
}
// namespace apollo
#endif // MODULES_MAP_PNC_MAP_TRAJECTORY_H_
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录