Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
e5c30555
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,发现更多精彩内容 >>
提交
e5c30555
编写于
7月 19, 2017
作者:
A
Aaron Xiao
提交者:
Jiangtao Hu
7月 19, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Migrate PublishableTrajectory to Apollo 1.5.
上级
281954da
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
142 addition
and
0 deletion
+142
-0
modules/planning/common/trajectory/BUILD
modules/planning/common/trajectory/BUILD
+14
-0
modules/planning/common/trajectory/publishable_trajectory.cc
modules/planning/common/trajectory/publishable_trajectory.cc
+73
-0
modules/planning/common/trajectory/publishable_trajectory.h
modules/planning/common/trajectory/publishable_trajectory.h
+55
-0
未找到文件。
modules/planning/common/trajectory/BUILD
浏览文件 @
e5c30555
...
...
@@ -27,3 +27,17 @@ cc_library(
"@eigen//:eigen"
,
],
)
cc_library
(
name
=
"publishable_trajectory"
,
srcs
=
[
"publishable_trajectory.cc"
,
],
hdrs
=
[
"publishable_trajectory.h"
,
],
deps
=
[
":discretized_trajectory"
,
"//modules/planning/proto:planning_proto"
,
],
)
modules/planning/common/trajectory/publishable_trajectory.cc
0 → 100644
浏览文件 @
e5c30555
/******************************************************************************
* 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 publishable_trajectory.cpp
**/
#include "modules/planning/common/trajectory/publishable_trajectory.h"
namespace
apollo
{
namespace
planning
{
using
apollo
::
common
::
TrajectoryPoint
;
TrajectoryPoint
PublishableTrajectory
::
evaluate_absolute_time
(
const
double
abs_time
)
const
{
return
evaluate
(
abs_time
-
_header_time
);
}
TrajectoryPoint
PublishableTrajectory
::
evaluate_linear_approximation_absolute_time
(
const
double
abs_time
)
const
{
return
evaluate_linear_approximation
(
abs_time
-
_header_time
);
}
std
::
size_t
PublishableTrajectory
::
query_nearest_point_absolute_time
(
const
double
abs_time
)
const
{
return
query_nearest_point
(
abs_time
-
_header_time
);
}
double
PublishableTrajectory
::
header_time
()
const
{
return
_header_time
;
}
void
PublishableTrajectory
::
set_header_time
(
const
double
header_time
)
{
_header_time
=
header_time
;
}
ADCTrajectory
PublishableTrajectory
::
to_trajectory_protobuf
()
const
{
ADCTrajectory
trajectory_pb
;
trajectory_pb
.
mutable_header
()
->
set_timestamp_sec
(
_header_time
);
for
(
const
auto
&
tp
:
_trajectory_points
)
{
const
auto
&
path_point
=
tp
.
path_point
();
auto
*
trajectory_point
=
trajectory_pb
.
add_adc_trajectory_point
();
trajectory_point
->
set_relative_time
(
tp
.
relative_time
());
trajectory_point
->
set_accumulated_s
(
path_point
.
s
());
trajectory_point
->
set_speed
(
tp
.
v
());
trajectory_point
->
set_acceleration_s
(
tp
.
a
());
trajectory_point
->
set_theta
(
path_point
.
theta
());
trajectory_point
->
set_curvature
(
path_point
.
kappa
());
trajectory_point
->
set_curvature_change_rate
(
path_point
.
dkappa
());
trajectory_point
->
set_x
(
path_point
.
x
());
trajectory_point
->
set_y
(
path_point
.
y
());
trajectory_point
->
set_z
(
0.0
);
}
return
trajectory_pb
;
}
}
//namespace planning
}
//namespace apollo
modules/planning/common/trajectory/publishable_trajectory.h
0 → 100644
浏览文件 @
e5c30555
/******************************************************************************
* 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 publishable_trajectory.h
**/
#ifndef MODULES_PLANNING_COMMON_TRAJECTORY_PUBLISHABLE_TRAJECTORY_H
#define MODULES_PLANNING_COMMON_TRAJECTORY_PUBLISHABLE_TRAJECTORY_H
#include "modules/planning/common/trajectory/discretized_trajectory.h"
#include "modules/planning/proto/planning.pb.h"
namespace
apollo
{
namespace
planning
{
class
PublishableTrajectory
:
public
DiscretizedTrajectory
{
public:
virtual
~
PublishableTrajectory
()
=
default
;
apollo
::
common
::
TrajectoryPoint
evaluate_absolute_time
(
const
double
abs_time
)
const
;
apollo
::
common
::
TrajectoryPoint
evaluate_linear_approximation_absolute_time
(
const
double
abs_time
)
const
;
std
::
size_t
query_nearest_point_absolute_time
(
const
double
abs_time
)
const
;
double
header_time
()
const
;
void
set_header_time
(
const
double
header_time
);
ADCTrajectory
to_trajectory_protobuf
()
const
;
private:
double
_header_time
;
};
}
// namespace planning
}
// namespace apollo
#endif // MODULES_PLANNING_COMMON_TRAJECTORY_PUBLISHABLE_TRAJECTORY_H
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录