Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
ae6bb1f7
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,发现更多精彩内容 >>
提交
ae6bb1f7
编写于
7月 19, 2017
作者:
D
Dong Li
提交者:
lianglia-apollo
7月 19, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove ErrorCode in planning (#50)
fix some style problems
上级
4712b248
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
41 addition
and
101 deletion
+41
-101
modules/planning/common/BUILD
modules/planning/common/BUILD
+1
-8
modules/planning/common/logic_node.cc
modules/planning/common/logic_node.cc
+7
-12
modules/planning/common/logic_node.h
modules/planning/common/logic_node.h
+9
-7
modules/planning/common/logic_point.h
modules/planning/common/logic_point.h
+3
-3
modules/planning/common/planning_error.h
modules/planning/common/planning_error.h
+0
-43
modules/planning/common/speed/speed_data.h
modules/planning/common/speed/speed_data.h
+3
-3
modules/planning/common/speed/speed_point.h
modules/planning/common/speed/speed_point.h
+3
-3
modules/planning/common/speed/st_point.h
modules/planning/common/speed/st_point.h
+3
-3
modules/planning/common/trajectory/trajectory.h
modules/planning/common/trajectory/trajectory.h
+2
-2
modules/planning/math/spiral_curve/quintic_spiral_curve.cc
modules/planning/math/spiral_curve/quintic_spiral_curve.cc
+7
-8
modules/planning/proto/planning_internal.proto
modules/planning/proto/planning_internal.proto
+3
-9
未找到文件。
modules/planning/common/BUILD
浏览文件 @
ae6bb1f7
...
...
@@ -29,14 +29,7 @@ cc_library(
],
deps
=
[
"//modules/common/math"
,
"//modules/planning/common:planning_error_code"
,
],
)
cc_library
(
name
=
"planning_error_code"
,
hdrs
=
[
"planning_error.h"
,
"//modules/common/proto:error_code_proto"
,
],
)
...
...
modules/planning/common/logic_node.cc
浏览文件 @
ae6bb1f7
...
...
@@ -26,16 +26,11 @@ namespace apollo {
namespace
planning
{
LogicNode
::
LogicNode
(
const
std
::
size_t
node_id
,
const
std
::
string
&
lane_id
)
:
_node_id
(
node_id
),
_lane_id
(
lane_id
)
{
}
:
_node_id
(
node_id
),
_lane_id
(
lane_id
)
{}
std
::
size_t
LogicNode
::
node_id
()
const
{
return
_node_id
;
}
std
::
size_t
LogicNode
::
node_id
()
const
{
return
_node_id
;
}
const
std
::
string
&
LogicNode
::
lane_id
()
const
{
return
_lane_id
;
}
const
std
::
string
&
LogicNode
::
lane_id
()
const
{
return
_lane_id
;
}
const
std
::
unordered_set
<
std
::
string
>
&
LogicNode
::
lane_name
()
const
{
return
_lane_name
;
...
...
@@ -50,15 +45,15 @@ void LogicNode::connect(const LogicNode &node) {
_edge
[
node
.
lane_id
()]
=
node
.
node_id
();
}
ErrorCode
LogicNode
::
get_next_node
(
const
std
::
string
&
lane_id
,
std
::
size_t
*
const
node_id
)
{
common
::
ErrorCode
LogicNode
::
get_next_node
(
const
std
::
string
&
lane_id
,
std
::
size_t
*
const
node_id
)
{
CHECK_NOTNULL
(
node_id
);
*
node_id
=
0
;
if
(
_edge
.
find
(
lane_id
)
==
_edge
.
end
())
{
return
ErrorCode
::
PLANNING_ERROR_NOT_FOUND
;
return
common
::
ErrorCode
::
PLANNING_ERROR
;
}
*
node_id
=
_edge
[
lane_id
];
return
ErrorCode
::
PLANNING_
OK
;
return
common
::
ErrorCode
::
OK
;
}
}
// namespace planning
...
...
modules/planning/common/logic_node.h
浏览文件 @
ae6bb1f7
...
...
@@ -18,15 +18,15 @@
* @file logic_node.h
**/
#ifndef MODULES_PLANNING_COMMON_LOGIC_NODE_H
#define MODULES_PLANNING_COMMON_LOGIC_NODE_H
#ifndef MODULES_PLANNING_COMMON_LOGIC_NODE_H
_
#define MODULES_PLANNING_COMMON_LOGIC_NODE_H
_
#include <memory>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <memory>
#include "modules/
planning/common/planning_error
.h"
#include "modules/
common/proto/error_code.pb
.h"
namespace
apollo
{
namespace
planning
{
...
...
@@ -39,8 +39,10 @@ class LogicNode {
const
std
::
unordered_set
<
std
::
string
>
&
lane_name
()
const
;
void
connect
(
const
LogicNode
&
node
);
void
add_lane_name
(
const
std
::
string
&
lane_name
);
ErrorCode
get_next_node
(
const
std
::
string
&
lane_id
,
std
::
size_t
*
const
node_id
);
common
::
ErrorCode
get_next_node
(
const
std
::
string
&
lane_id
,
std
::
size_t
*
const
node_id
);
void
f
()
{}
private:
std
::
size_t
_node_id
;
std
::
string
_lane_id
;
...
...
@@ -51,4 +53,4 @@ class LogicNode {
}
// namespace planning
}
// namespace apollo
#endif // MODULES_PLANNING_COMMON_LOGIC_NODE_H
#endif // MODULES_PLANNING_COMMON_LOGIC_NODE_H
_
modules/planning/common/logic_point.h
浏览文件 @
ae6bb1f7
...
...
@@ -18,8 +18,8 @@
* @file logic_point.h
**/
#ifndef MODULES_PLANNING_COMMON_LOGIC_POINT_H
#define MODULES_PLANNING_COMMON_LOGIC_POINT_H
#ifndef MODULES_PLANNING_COMMON_LOGIC_POINT_H
_
#define MODULES_PLANNING_COMMON_LOGIC_POINT_H
_
#include <string>
#include "modules/common/math/vec2d.h"
...
...
@@ -54,4 +54,4 @@ class LogicPoint : public ::apollo::common::math::Vec2d {
}
// namespace planning
}
// namespace apollo
#endif // MODULES_PLANNING_COMMON_LOGIC_POINT_H
#endif // MODULES_PLANNING_COMMON_LOGIC_POINT_H
_
modules/planning/common/planning_error.h
已删除
100644 → 0
浏览文件 @
4712b248
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
/**
* @file planning_error.h
**/
#ifndef MODULES_PLANNING_COMMON_PLANNING_ERROR_H
#define MODULES_PLANNING_COMMON_PLANNING_ERROR_H
namespace
apollo
{
namespace
planning
{
enum
class
ErrorCode
{
PLANNING_SKIP
=
1
,
PLANNING_OK
=
0
,
PLANNING_ERROR_NOT_FOUND
=
-
1
,
PLANNING_ERROR_OUT_OF_INDEX
=
-
2
,
PLANNING_ERROR_SELF_LOOP
=
-
3
,
PLANNING_ERROR_DUPLICATE
=
-
4
,
PLANNING_ERROR_NULL_POINTER
=
-
5
,
PLANNING_ERROR_NAN
=
-
6
,
PLANNING_ERROR_TIMEOUT
=
-
7
,
PLANNING_ERROR_FAILED
=
-
8
,
};
}
// namespace planning
}
// namespace apollo
#endif // MODULES_PLANNING_COMMON_PLANNING_ERROR_H
modules/planning/common/speed/speed_data.h
浏览文件 @
ae6bb1f7
...
...
@@ -17,8 +17,8 @@
/**
* @file speed_data.h
**/
#ifndef MODULES_PLANNING_COMMON_SPEED_SPEED_DATA_H
#define MODULES_PLANNING_COMMON_SPEED_SPEED_DATA_H
#ifndef MODULES_PLANNING_COMMON_SPEED_SPEED_DATA_H
_
#define MODULES_PLANNING_COMMON_SPEED_SPEED_DATA_H
_
#include <vector>
...
...
@@ -55,4 +55,4 @@ class SpeedData {
}
// namespace planning
}
// namespace apollo
#endif // MODULES_PLANNING_COMMON_SPEED_SPEED_DATA_H
#endif // MODULES_PLANNING_COMMON_SPEED_SPEED_DATA_H
_
modules/planning/common/speed/speed_point.h
浏览文件 @
ae6bb1f7
...
...
@@ -18,8 +18,8 @@
* @file
**/
#ifndef MODULES_PLANNING_COMMON_SPEED_SPEED_POINT_H
#define MODULES_PLANNING_COMMON_SPEED_SPEED_POINT_H
#ifndef MODULES_PLANNING_COMMON_SPEED_SPEED_POINT_H
_
#define MODULES_PLANNING_COMMON_SPEED_SPEED_POINT_H
_
#include "modules/planning/common/speed/st_point.h"
...
...
@@ -54,4 +54,4 @@ class SpeedPoint : public STPoint {
}
// namespace planning
}
// namespace apollo
#endif // MODULES_PLANNING_COMMON_SPEED_SPEED_POINT_H
#endif // MODULES_PLANNING_COMMON_SPEED_SPEED_POINT_H
_
modules/planning/common/speed/st_point.h
浏览文件 @
ae6bb1f7
...
...
@@ -18,8 +18,8 @@
* @file st_point.h
**/
#ifndef MODULES_PLANNING_COMMON_SPEED_ST_POINT_H
#define MODULES_PLANNING_COMMON_SPEED_ST_POINT_H
#ifndef MODULES_PLANNING_COMMON_SPEED_ST_POINT_H
_
#define MODULES_PLANNING_COMMON_SPEED_ST_POINT_H
_
#include "modules/common/math/vec2d.h"
...
...
@@ -40,4 +40,4 @@ class STPoint : public ::apollo::common::math::Vec2d {
}
// namespace planning
}
// namespace apollo
#endif // MODULES_PLANNING_COMMON_SPEED_ST_POINT_H
#endif // MODULES_PLANNING_COMMON_SPEED_ST_POINT_H
_
modules/planning/common/trajectory/trajectory.h
浏览文件 @
ae6bb1f7
...
...
@@ -25,7 +25,7 @@
#include "modules/common/proto/path_point.pb.h"
namespace
a
du
{
namespace
a
pollo
{
namespace
planning
{
class
Trajectory
{
...
...
@@ -44,6 +44,6 @@ class Trajectory {
};
}
// namespace planning
}
// namespace a
du
}
// namespace a
pollo
#endif // MODULES_PLANNING_COMMON_TRAJECTORY_TRAJECTORY_H_
modules/planning/math/spiral_curve/quintic_spiral_curve.cc
浏览文件 @
ae6bb1f7
...
...
@@ -30,7 +30,6 @@
namespace
apollo
{
namespace
planning
{
using
::
apollo
::
common
::
ErrorCode
;
using
::
apollo
::
common
::
PathPoint
;
QuinticSpiralCurve
::
QuinticSpiralCurve
(
const
common
::
PathPoint
&
s
,
...
...
@@ -191,12 +190,12 @@ bool QuinticSpiralCurve::calculate_path() {
return
diff
<
spiral_config
().
newton_raphson_tol
()
&&
result_sanity_check
();
}
ErrorCode
QuinticSpiralCurve
::
get_path_vec
(
common
::
ErrorCode
QuinticSpiralCurve
::
get_path_vec
(
const
std
::
size_t
n
,
std
::
vector
<
common
::
PathPoint
>*
path_points
)
const
{
CHECK_NOTNULL
(
path_points
);
if
(
n
<=
1
||
error
()
>
spiral_config
().
newton_raphson_tol
())
{
return
ErrorCode
::
PLANNING_ERROR
;
return
common
::
ErrorCode
::
PLANNING_ERROR
;
}
path_points
->
resize
(
n
);
...
...
@@ -243,20 +242,20 @@ ErrorCode QuinticSpiralCurve::get_path_vec(
result
[
k
].
set_y
(
result
[
k
].
s
()
*
dy
+
result
[
0
].
y
());
}
return
ErrorCode
::
OK
;
return
common
::
ErrorCode
::
OK
;
}
ErrorCode
QuinticSpiralCurve
::
get_path_vec_with_s
(
common
::
ErrorCode
QuinticSpiralCurve
::
get_path_vec_with_s
(
const
std
::
vector
<
double
>&
vec_s
,
std
::
vector
<
common
::
PathPoint
>*
path_points
)
const
{
CHECK_NOTNULL
(
path_points
);
if
(
error
()
>
spiral_config
().
newton_raphson_tol
())
{
return
ErrorCode
::
PLANNING_ERROR
;
return
common
::
ErrorCode
::
PLANNING_ERROR
;
}
if
(
vec_s
.
size
()
==
0
)
{
return
ErrorCode
::
OK
;
return
common
::
ErrorCode
::
OK
;
}
const
std
::
size_t
n
=
vec_s
.
size
();
...
...
@@ -304,7 +303,7 @@ ErrorCode QuinticSpiralCurve::get_path_vec_with_s(
result
[
k
].
set_y
(
dy
+
ref_point
.
y
());
}
return
ErrorCode
::
OK
;
return
common
::
ErrorCode
::
OK
;
}
}
// namespace planning
...
...
modules/planning/proto/planning_internal.proto
浏览文件 @
ae6bb1f7
...
...
@@ -3,6 +3,7 @@ syntax = "proto2";
package
apollo
.
planning_internal
;
import
"modules/common/proto/header.proto"
;
import
"modules/common/proto/error_code.proto"
;
import
"modules/decision/proto/decision.proto"
;
import
"modules/localization/proto/localization.proto"
;
import
"modules/localization/proto/pose.proto"
;
...
...
@@ -48,19 +49,12 @@ message PlanningObstacle {
}
message
Debug
{
enum
ErrorCode
{
OK
=
0
;
ERR_NOT_READY
=
1
;
ERR_ESTOP
=
2
;
ERR_PATH_OPTIMIZER
=
3
;
ERR_SPEED_OPTIMIZER
=
4
;
ERR_ST_GRAPH
=
5
;
ERR_SANITY_CHECK
=
6
;
}
/*
PLEASE add id here
id = 1: st_graph_info
*/
message
DebugMessage
{
optional
ErrorCode
error_code
=
1
[
default
=
OK
]
;
optional
apollo.common.ErrorCode
error_code
=
1
;
optional
int32
id
=
2
;
oneof
debug_string
{
string
trace
=
3
;
...
...
@@ -71,7 +65,7 @@ message Debug {
}
}
optional
ErrorCode
error_code
=
1
[
default
=
OK
]
;
optional
apollo.common.ErrorCode
error_code
=
1
;
optional
PlanningData
planning_data
=
2
;
repeated
DebugMessage
debug_message
=
3
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录