Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
160b7b4b
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,发现更多精彩内容 >>
提交
160b7b4b
编写于
9月 05, 2017
作者:
Z
Zhang Liangliang
提交者:
Dong Li
9月 05, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
common, dreamview, map, routing: fixed issues from cppcheck.
上级
7363834c
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
30 addition
and
65 deletion
+30
-65
modules/common/util/util.cc
modules/common/util/util.cc
+0
-18
modules/common/util/util.h
modules/common/util/util.h
+2
-8
modules/dreamview/backend/map/map_service.cc
modules/dreamview/backend/map/map_service.cc
+3
-3
modules/map/hdmap/adapter/xml_parser/lanes_xml_parser.cc
modules/map/hdmap/adapter/xml_parser/lanes_xml_parser.cc
+3
-1
modules/map/hdmap/hdmap_common.cc
modules/map/hdmap/hdmap_common.cc
+1
-1
modules/map/pnc_map/pnc_map.cc
modules/map/pnc_map/pnc_map.cc
+0
-2
modules/routing/graph/topo_node.cc
modules/routing/graph/topo_node.cc
+21
-32
未找到文件。
modules/common/util/util.cc
浏览文件 @
160b7b4b
...
...
@@ -29,14 +29,6 @@ SLPoint MakeSLPoint(const double s, const double l) {
return
sl
;
}
Point3D
MakePoint3D
(
const
double
x
,
const
double
y
,
const
double
z
)
{
Point3D
point3d
;
point3d
.
set_x
(
x
);
point3d
.
set_y
(
y
);
point3d
.
set_z
(
z
);
return
point3d
;
}
PointENU
MakePointENU
(
const
double
x
,
const
double
y
,
const
double
z
)
{
PointENU
point_enu
;
point_enu
.
set_x
(
x
);
...
...
@@ -86,16 +78,6 @@ PathPoint MakePathPoint(const double x, const double y, const double z,
path_point
.
set_ddkappa
(
ddkappa
);
return
path_point
;
}
TrajectoryPoint
MakeTrajectoryPoint
(
const
PathPoint
&
path_point
,
const
double
v
,
const
double
a
,
const
double
relative_time
)
{
TrajectoryPoint
point
;
point
.
mutable_path_point
()
->
CopyFrom
(
path_point
);
point
.
set_v
(
v
);
point
.
set_a
(
a
);
point
.
set_relative_time
(
relative_time
);
return
point
;
}
double
Distance2D
(
const
PathPoint
&
a
,
const
PathPoint
&
b
)
{
return
std
::
hypot
(
a
.
x
()
-
b
.
x
(),
a
.
y
()
-
b
.
y
());
...
...
modules/common/util/util.h
浏览文件 @
160b7b4b
...
...
@@ -60,8 +60,6 @@ bool IsProtoEqual(const ProtoA& a, const ProtoB& b) {
*/
SLPoint
MakeSLPoint
(
const
double
s
,
const
double
l
);
Point3D
MakePoint3D
(
const
double
x
,
const
double
y
,
const
double
z
);
PointENU
MakePointENU
(
const
double
x
,
const
double
y
,
const
double
z
);
PointENU
MakePointENU
(
const
math
::
Vec2d
&
xy
);
...
...
@@ -69,17 +67,13 @@ PointENU MakePointENU(const math::Vec2d& xy);
apollo
::
perception
::
Point
MakePerceptionPoint
(
const
double
x
,
const
double
y
,
const
double
z
);
SpeedPoint
MakeSpeedPoint
(
const
double
s
,
const
double
t
,
const
double
v
,
const
double
a
,
const
double
da
);
SpeedPoint
MakeSpeedPoint
(
const
double
s
,
const
double
t
,
const
double
v
,
const
double
a
,
const
double
da
);
PathPoint
MakePathPoint
(
const
double
x
,
const
double
y
,
const
double
z
,
const
double
theta
,
const
double
kappa
,
const
double
dkappa
,
const
double
ddkappa
);
TrajectoryPoint
MakeTrajectoryPoint
(
const
PathPoint
&
path_point
,
const
double
v
,
const
double
a
,
const
double
relative_time
);
/**
* calculate the distance beteween PathPoint a and PathPoint b
* @param a one path point
...
...
modules/dreamview/backend/map/map_service.cc
浏览文件 @
160b7b4b
...
...
@@ -67,7 +67,7 @@ void ExtractOverlapIds(const std::vector<MapElementInfoConstPtr> &items,
}
void
ExtractStringVectorFromJson
(
const
nlohmann
::
json
&
json_object
,
const
std
::
string
key
,
const
std
::
string
&
key
,
std
::
vector
<
std
::
string
>
*
result
)
{
auto
iter
=
json_object
.
find
(
key
);
if
(
iter
!=
json_object
.
end
())
{
...
...
@@ -255,8 +255,8 @@ bool MapService::GetPointsFromRouting(const RoutingResponse &routing,
}
constexpr
double
angle_threshold
=
0.1
;
// threshold is about 5.72 degree.
std
::
vector
<
int
>
sampled_indices
=
DownsampleByAngle
(
path
.
path_points
(),
angle_threshold
);
std
::
vector
<
int
>
sampled_indices
=
DownsampleByAngle
(
path
.
path_points
(),
angle_threshold
);
for
(
int
index
:
sampled_indices
)
{
points
->
push_back
(
path
.
path_points
()[
index
]);
}
...
...
modules/map/hdmap/adapter/xml_parser/lanes_xml_parser.cc
浏览文件 @
160b7b4b
...
...
@@ -219,7 +219,9 @@ Status LanesXmlParser::ParseLane(const tinyxml2::XMLElement& xml_node,
}
// road mark
sub_node
=
sub_node
->
FirstChildElement
(
"borderType"
);
if
(
sub_node
)
{
sub_node
=
sub_node
->
FirstChildElement
(
"borderType"
);
}
while
(
sub_node
)
{
PbLaneBoundary
*
lane_boundary
=
lane
->
mutable_right_boundary
();
PbLaneBoundaryTypeType
boundary_type
;
...
...
modules/map/hdmap/hdmap_common.cc
浏览文件 @
160b7b4b
...
...
@@ -141,9 +141,9 @@ void LaneInfo::Init() {
sampled_right_width_
.
emplace_back
(
sample
.
s
(),
sample
.
width
());
}
const
double
kMinHalfWidth
=
1.05
;
if
(
lane_
.
has_type
())
{
if
(
lane_
.
type
()
==
Lane
::
CITY_DRIVING
)
{
const
double
kMinHalfWidth
=
1.05
;
for
(
const
auto
&
p
:
sampled_left_width_
)
{
if
(
p
.
second
<
kMinHalfWidth
)
{
AERROR
...
...
modules/map/pnc_map/pnc_map.cc
浏览文件 @
160b7b4b
...
...
@@ -323,8 +323,6 @@ bool PncMap::TruncateLaneSegments(
return
false
;
}
const
double
kRouteEpsilon
=
1e-3
;
std
::
vector
<
MapPathPoint
>
points
;
std
::
vector
<
LaneSegment
>
lane_segments
;
// Extend the trajectory towards the start of the trajectory.
if
(
start_s
<
0
)
{
const
auto
&
first_segment
=
segments
[
0
];
...
...
modules/routing/graph/topo_node.cc
浏览文件 @
160b7b4b
...
...
@@ -20,8 +20,8 @@
#include <cmath>
#include <utility>
#include "modules/routing/graph/range_utils.h"
#include "modules/common/log.h"
#include "modules/routing/graph/range_utils.h"
namespace
apollo
{
namespace
routing
{
...
...
@@ -33,16 +33,12 @@ const double MIN_INTERNAL_FOR_NODE = 0.01; // in meter
using
::
google
::
protobuf
::
RepeatedPtrField
;
void
ConvertOutRange
(
const
RepeatedPtrField
<
CurveRange
>&
range_vec
,
double
start_s
,
double
end_s
,
std
::
vector
<
NodeSRange
>*
out_range
,
int
*
prefer_index
)
{
double
start_s
,
double
end_s
,
std
::
vector
<
NodeSRange
>*
out_range
,
int
*
prefer_index
)
{
out_range
->
clear
();
double
s_s
=
0.0
;
double
e_s
=
0.0
;
for
(
const
auto
&
c_range
:
range_vec
)
{
s_s
=
c_range
.
start
().
s
();
e_s
=
c_range
.
end
().
s
();
double
s_s
=
c_range
.
start
().
s
();
double
e_s
=
c_range
.
end
().
s
();
if
(
e_s
<
start_s
||
s_s
>
end_s
||
e_s
<
s_s
)
{
continue
;
}
...
...
@@ -66,8 +62,7 @@ void ConvertOutRange(const RepeatedPtrField<CurveRange>& range_vec,
}
// namespace
bool
TopoNode
::
IsOutRangeEnough
(
const
std
::
vector
<
NodeSRange
>&
range_vec
,
double
start_s
,
double
end_s
)
{
double
start_s
,
double
end_s
)
{
if
(
!
NodeSRange
::
IsEnoughForChangeLane
(
start_s
,
end_s
))
{
return
false
;
}
...
...
@@ -119,14 +114,15 @@ void TopoNode::Init() {
ConvertOutRange
(
pb_node_
.
left_out
(),
start_s_
,
end_s_
,
&
left_out_sorted_range_
,
&
left_prefer_range_index_
);
is_left_range_enough_
=
(
left_prefer_range_index_
>=
0
)
&&
is_left_range_enough_
=
(
left_prefer_range_index_
>=
0
)
&&
left_out_sorted_range_
[
left_prefer_range_index_
].
IsEnoughForChangeLane
();
ConvertOutRange
(
pb_node_
.
right_out
(),
start_s_
,
end_s_
,
&
right_out_sorted_range_
,
&
right_prefer_range_index_
);
is_right_range_enough_
=
(
right_prefer_range_index_
>=
0
)
&&
right_out_sorted_range_
[
right_prefer_range_index_
]
.
IsEnoughForChangeLane
();
right_out_sorted_range_
[
right_prefer_range_index_
]
.
IsEnoughForChangeLane
();
}
bool
TopoNode
::
FindAnchorPoint
()
{
...
...
@@ -146,8 +142,7 @@ bool TopoNode::FindAnchorPoint() {
return
false
;
}
void
TopoNode
::
SetAnchorPoint
(
const
::
apollo
::
common
::
PointENU
&
anchor_point
)
{
void
TopoNode
::
SetAnchorPoint
(
const
::
apollo
::
common
::
PointENU
&
anchor_point
)
{
anchor_point_
=
anchor_point
;
}
...
...
@@ -187,13 +182,12 @@ const std::unordered_set<const TopoEdge*>& TopoNode::InFromLeftEdge() const {
return
in_from_left_edge_set_
;
}
const
std
::
unordered_set
<
const
TopoEdge
*>&
TopoNode
::
InFromRightEdge
()
const
{
const
std
::
unordered_set
<
const
TopoEdge
*>&
TopoNode
::
InFromRightEdge
()
const
{
return
in_from_right_edge_set_
;
}
const
std
::
unordered_set
<
const
TopoEdge
*>&
TopoNode
::
InFromLeftOrRightEdge
()
const
{
const
std
::
unordered_set
<
const
TopoEdge
*>&
TopoNode
::
InFromLeftOrRightEdge
()
const
{
return
in_from_left_or_right_edge_set_
;
}
...
...
@@ -213,8 +207,8 @@ const std::unordered_set<const TopoEdge*>& TopoNode::OutToRightEdge() const {
return
out_to_right_edge_set_
;
}
const
std
::
unordered_set
<
const
TopoEdge
*>&
TopoNode
::
OutToLeftOrRightEdge
()
const
{
const
std
::
unordered_set
<
const
TopoEdge
*>&
TopoNode
::
OutToLeftOrRightEdge
()
const
{
return
out_to_left_or_right_edge_set_
;
}
...
...
@@ -250,14 +244,12 @@ bool TopoNode::IsOverlapEnough(const TopoNode* sub_node,
const
TopoEdge
*
edge_for_type
)
const
{
if
(
edge_for_type
->
Type
()
==
TET_LEFT
)
{
return
(
is_left_range_enough_
&&
IsOutRangeEnough
(
left_out_sorted_range_
,
sub_node
->
StartS
(),
IsOutRangeEnough
(
left_out_sorted_range_
,
sub_node
->
StartS
(),
sub_node
->
EndS
()));
}
if
(
edge_for_type
->
Type
()
==
TET_RIGHT
)
{
return
(
is_right_range_enough_
&&
IsOutRangeEnough
(
right_out_sorted_range_
,
sub_node
->
StartS
(),
IsOutRangeEnough
(
right_out_sorted_range_
,
sub_node
->
StartS
(),
sub_node
->
EndS
()));
}
if
(
edge_for_type
->
Type
()
==
TET_FORWARD
)
{
...
...
@@ -322,9 +314,8 @@ bool TopoNode::IsOutToSucEdgeValid() const {
return
std
::
fabs
(
EndS
()
-
OriginNode
()
->
EndS
())
<
MIN_INTERNAL_FOR_NODE
;
}
TopoEdge
::
TopoEdge
(
const
Edge
&
edge
,
const
TopoNode
*
from_node
,
const
TopoNode
*
to_node
)
TopoEdge
::
TopoEdge
(
const
Edge
&
edge
,
const
TopoNode
*
from_node
,
const
TopoNode
*
to_node
)
:
pb_edge_
(
edge
),
from_node_
(
from_node
),
to_node_
(
to_node
)
{}
TopoEdge
::~
TopoEdge
()
{}
...
...
@@ -341,9 +332,7 @@ const std::string& TopoEdge::FromLaneId() const {
return
pb_edge_
.
from_lane_id
();
}
const
std
::
string
&
TopoEdge
::
ToLaneId
()
const
{
return
pb_edge_
.
to_lane_id
();
}
const
std
::
string
&
TopoEdge
::
ToLaneId
()
const
{
return
pb_edge_
.
to_lane_id
();
}
TopoEdgeType
TopoEdge
::
Type
()
const
{
if
(
pb_edge_
.
direction_type
()
==
Edge
::
LEFT
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录