Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
81ae48db
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,体验更适合开发者的 AI 搜索 >>
提交
81ae48db
编写于
4月 17, 2018
作者:
Y
YajiaZhang
提交者:
Jiangtao Hu
4月 17, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
common: fixed a couple of problems due to code migration
上级
ba9a80c7
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
54 addition
and
51 deletion
+54
-51
modules/common/math/BUILD
modules/common/math/BUILD
+26
-0
modules/common/math/hermite_spline.h
modules/common/math/hermite_spline.h
+8
-6
modules/common/math/nonlinear_interpolation.cc
modules/common/math/nonlinear_interpolation.cc
+9
-8
modules/common/math/nonlinear_interpolation.h
modules/common/math/nonlinear_interpolation.h
+11
-12
modules/planning/common/BUILD
modules/planning/common/BUILD
+0
-3
modules/planning/common/planning_util.cc
modules/planning/common/planning_util.cc
+0
-12
modules/planning/math/BUILD
modules/planning/math/BUILD
+0
-10
未找到文件。
modules/common/math/BUILD
浏览文件 @
81ae48db
...
...
@@ -186,6 +186,22 @@ cc_library(
],
)
cc_library
(
name
=
"nonlinear_interpolation"
,
srcs
=
[
"nonlinear_interpolation.cc"
,
],
hdrs
=
[
"nonlinear_interpolation.h"
,
],
deps
=
[
":geometry"
,
":hermite_spline"
,
":integral"
,
"//modules/common/proto:pnc_point_proto"
,
],
)
cc_library
(
name
=
"integral"
,
srcs
=
[
...
...
@@ -244,6 +260,16 @@ cc_library(
],
)
cc_library
(
name
=
"hermite_spline"
,
hdrs
=
[
"hermite_spline.h"
,
],
deps
=
[
"//modules/common:log"
,
],
)
cc_test
(
name
=
"mpc_test"
,
size
=
"small"
,
...
...
modules/
planning
/math/hermite_spline.h
→
modules/
common
/math/hermite_spline.h
浏览文件 @
81ae48db
/******************************************************************************
* Copyright 201
7
The Apollo Authors. All Rights Reserved.
* Copyright 201
8
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.
...
...
@@ -18,8 +18,8 @@
* @file
**/
#ifndef MODULES_
PLANNING
_MATH_HERMITE_SPLINE_H_
#define MODULES_
PLANNING
_MATH_HERMITE_SPLINE_H_
#ifndef MODULES_
COMMON
_MATH_HERMITE_SPLINE_H_
#define MODULES_
COMMON
_MATH_HERMITE_SPLINE_H_
#include <array>
#include <utility>
...
...
@@ -27,7 +27,8 @@
#include "modules/common/log.h"
namespace
apollo
{
namespace
planning
{
namespace
common
{
namespace
math
{
// Hermite spline implementation that works for 1d and 2d space interpolation.
// Valid input type T: double, Eigen::Vector2d
...
...
@@ -200,7 +201,8 @@ inline T HermiteSpline<T, N>::Evaluate(const std::uint32_t order,
return
T
();
}
}
// namespace planning
}
// namespace math
}
// namespace common
}
// namespace apollo
#endif // MODULES_
PLANNING
_MATH_HERMITE_SPLINE_H_
#endif // MODULES_
COMMON
_MATH_HERMITE_SPLINE_H_
modules/common/math/
polynomial
_interpolation.cc
→
modules/common/math/
nonlinear
_interpolation.cc
浏览文件 @
81ae48db
/******************************************************************************
* Copyright 201
7
The Apollo Authors. All Rights Reserved.
* Copyright 201
8
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.
...
...
@@ -13,20 +13,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/common/math/polynomial_interpolation.h"
#include "modules/common/math/nonlinear_interpolation.h"
#include <cmath>
#include "modules/common/log.h"
#include "modules/common/math/hermite_spline.h"
#include "modules/common/math/integral.h"
#include "modules/common/math/math_utils.h"
namespace
apollo
{
namespace
common
{
namespace
math
{
PathPoint
Polynomial
Interpolate
(
const
PathPoint
&
p0
,
const
PathPoint
&
p1
,
const
double
s
)
{
PathPoint
Spline
Interpolate
(
const
PathPoint
&
p0
,
const
PathPoint
&
p1
,
const
double
s
)
{
double
s0
=
p0
.
s
();
double
s1
=
p1
.
s
();
CHECK
(
s0
<=
s
&&
s
<=
s1
);
...
...
@@ -64,9 +65,9 @@ PathPoint PolynomialInterpolate(const PathPoint &p0, const PathPoint &p1,
return
p
;
}
TrajectoryPoint
Polynomial
Interpolate
(
const
TrajectoryPoint
&
tp0
,
const
TrajectoryPoint
&
tp1
,
const
double
t
)
{
TrajectoryPoint
Spline
Interpolate
(
const
TrajectoryPoint
&
tp0
,
const
TrajectoryPoint
&
tp1
,
const
double
t
)
{
if
(
std
::
fabs
(
tp1
.
path_point
().
s
()
-
tp0
.
path_point
().
s
())
<
1.0e-4
)
{
return
tp1
;
}
...
...
modules/common/math/
polynomial
_interpolation.h
→
modules/common/math/
nonlinear
_interpolation.h
浏览文件 @
81ae48db
/******************************************************************************
* Copyright 201
7
The Apollo Authors. All Rights Reserved.
* Copyright 201
8
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.
...
...
@@ -16,33 +16,32 @@
/**
* @file
* @brief
L
inear interpolation functions.
* @brief
Nonl
inear interpolation functions.
*/
#ifndef MODULES_COMMON_MATH_LINEAR_INTERPOLATION_H_
#define MODULES_COMMON_MATH_LINEAR_INTERPOLATION_H_
#ifndef MODULES_COMMON_MATH_
NON
LINEAR_INTERPOLATION_H_
#define MODULES_COMMON_MATH_
NON
LINEAR_INTERPOLATION_H_
#include <cmath>
#include "modules/common/log.h"
#include "modules/common/proto/pnc_point.pb.h"
/**
* @namespace apollo::common::math
* @brief apollo::common::math
*/
namespace
apollo
{
namespace
common
{
namespace
math
{
SLPoint
PolynomialInterpolate
(
const
SLPoint
&
start
,
const
SLPoint
&
end
,
const
double
weight
);
PathPoint
SplineInterpolate
(
const
PathPoint
&
p0
,
const
PathPoint
&
p1
,
const
double
s
);
PathPoint
PolynomialInterpolate
(
const
PathPoint
&
p0
,
const
PathPoint
&
p1
,
const
double
s
);
TrajectoryPoint
SplineInterpolate
(
const
TrajectoryPoint
&
tp0
,
const
TrajectoryPoint
&
tp1
,
const
double
t
);
}
// namespace math
}
// namespace common
}
// namespace apollo
#endif // MODULES_COMMON_MATH_LINEAR_INTERPOLATION_H_
#endif // MODULES_COMMON_MATH_
NON
LINEAR_INTERPOLATION_H_
modules/planning/common/BUILD
浏览文件 @
81ae48db
...
...
@@ -137,9 +137,6 @@ cc_library(
deps
=
[
":planning_gflags"
,
"//modules/common/adapters:adapter_manager"
,
"//modules/common/math"
,
"//modules/common/proto:pnc_point_proto"
,
"//modules/planning/math:hermite_spline"
,
"//modules/planning/proto:planning_proto"
,
"//modules/planning/proto:planning_status_proto"
,
],
...
...
modules/planning/common/planning_util.cc
浏览文件 @
81ae48db
...
...
@@ -16,25 +16,13 @@
#include "modules/planning/common/planning_util.h"
#include <array>
#include <cmath>
#include <memory>
#include <utility>
#include "modules/common/adapters/adapter_manager.h"
#include "modules/common/math/integral.h"
#include "modules/common/math/linear_interpolation.h"
#include "modules/common/math/math_utils.h"
#include "modules/planning/common/planning_gflags.h"
#include "modules/planning/math/hermite_spline.h"
namespace
apollo
{
namespace
planning
{
namespace
util
{
using
common
::
PathPoint
;
using
common
::
SpeedPoint
;
using
common
::
TrajectoryPoint
;
using
common
::
adapter
::
AdapterManager
;
PlanningStatus
*
GetPlanningStatus
()
{
...
...
modules/planning/math/BUILD
浏览文件 @
81ae48db
...
...
@@ -37,14 +37,4 @@ cc_library(
],
)
cc_library
(
name
=
"hermite_spline"
,
hdrs
=
[
"hermite_spline.h"
,
],
deps
=
[
"//modules/common:log"
,
],
)
cpplint
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录