Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
935b9b9d
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,发现更多精彩内容 >>
提交
935b9b9d
编写于
2月 22, 2018
作者:
K
kechxu
提交者:
Kecheng Xu
2月 22, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prediction: add relative_map_container
上级
b14a84bf
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
129 addition
and
4 deletion
+129
-4
modules/prediction/conf/adapter.conf
modules/prediction/conf/adapter.conf
+5
-0
modules/prediction/container/BUILD
modules/prediction/container/BUILD
+1
-0
modules/prediction/container/container_manager.cc
modules/prediction/container/container_manager.cc
+3
-0
modules/prediction/container/relative_map/BUILD
modules/prediction/container/relative_map/BUILD
+16
-0
modules/prediction/container/relative_map/relative_map_container.cc
...ediction/container/relative_map/relative_map_container.cc
+33
-0
modules/prediction/container/relative_map/relative_map_container.h
...rediction/container/relative_map/relative_map_container.h
+55
-0
modules/prediction/prediction.cc
modules/prediction/prediction.cc
+13
-4
modules/prediction/prediction.h
modules/prediction/prediction.h
+3
-0
未找到文件。
modules/prediction/conf/adapter.conf
浏览文件 @
935b9b9d
...
...
@@ -13,6 +13,11 @@ config {
mode
:
RECEIVE_ONLY
message_history_limit
:
1
}
config
{
type
:
RELATIVE_MAP
mode
:
RECEIVE_ONLY
message_history_limit
:
1
}
config
{
type
:
PREDICTION
mode
:
PUBLISH_ONLY
...
...
modules/prediction/container/BUILD
浏览文件 @
935b9b9d
...
...
@@ -13,6 +13,7 @@ cc_library(
"//modules/prediction/container/obstacles:obstacles_container"
,
"//modules/prediction/container/pose:pose_container"
,
"//modules/prediction/container/adc_trajectory:adc_trajectory_container"
,
"//modules/prediction/container/relative_map:relative_map_container"
,
"@glog//:glog"
,
],
)
...
...
modules/prediction/container/container_manager.cc
浏览文件 @
935b9b9d
...
...
@@ -20,6 +20,7 @@
#include "modules/prediction/container/obstacles/obstacles_container.h"
#include "modules/prediction/container/pose/pose_container.h"
#include "modules/prediction/container/adc_trajectory/adc_trajectory_container.h"
#include "modules/prediction/container/relative_map/relative_map_container.h"
namespace
apollo
{
namespace
prediction
{
...
...
@@ -62,6 +63,8 @@ std::unique_ptr<Container> ContainerManager::CreateContainer(
container_ptr
.
reset
(
new
PoseContainer
());
}
else
if
(
type
==
AdapterConfig
::
PLANNING_TRAJECTORY
)
{
container_ptr
.
reset
(
new
ADCTrajectoryContainer
());
}
else
if
(
type
==
AdapterConfig
::
RELATIVE_MAP
)
{
container_ptr
.
reset
(
new
RelativeMapContainer
());
}
return
container_ptr
;
}
...
...
modules/prediction/container/relative_map/BUILD
0 → 100644
浏览文件 @
935b9b9d
load
(
"//tools:cpplint.bzl"
,
"cpplint"
)
package
(
default_visibility
=
[
"//visibility:public"
])
cc_library
(
name
=
"relative_map_container"
,
srcs
=
[
"relative_map_container.cc"
],
hdrs
=
[
"relative_map_container.h"
],
deps
=
[
"//modules/common:log"
,
"//modules/map/relative_map:relative_map_lib"
,
"//modules/prediction/container"
,
],
)
cpplint
()
modules/prediction/container/relative_map/relative_map_container.cc
0 → 100644
浏览文件 @
935b9b9d
/******************************************************************************
* Copyright 2018 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.
*****************************************************************************/
#include "modules/prediction/container/relative_map/relative_map_container.h"
#include "modules/common/log.h"
namespace
apollo
{
namespace
prediction
{
using
apollo
::
relative_map
::
MapMsg
;
void
RelativeMapContainer
::
Insert
(
const
::
google
::
protobuf
::
Message
&
message
)
{
relative_map_
.
CopyFrom
(
dynamic_cast
<
const
MapMsg
&>
(
message
));
ADEBUG
<<
"Received a planning message ["
<<
relative_map_
.
ShortDebugString
()
<<
"]."
;
}
}
// namespace prediction
}
// namespace apollo
modules/prediction/container/relative_map/relative_map_container.h
0 → 100644
浏览文件 @
935b9b9d
/******************************************************************************
* Copyright 2018 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
*/
#ifndef MODULES_PREDICTION_CONTAINER_RELATIVE_MAP_CONTAINER_H_
#define MODULES_PREDICTION_CONTAINER_RELATIVE_MAP_CONTAINER_H_
#include "modules/prediction/container/container.h"
#include "modules/map/relative_map/proto/navigation.pb.h"
namespace
apollo
{
namespace
prediction
{
class
RelativeMapContainer
:
public
Container
{
public:
/**
* @brief Constructor
*/
RelativeMapContainer
()
=
default
;
/**
* @brief Destructor
*/
virtual
~
RelativeMapContainer
()
=
default
;
/**
* @brief Insert a data message into the container
* @param Data message to be inserted in protobuf
*/
void
Insert
(
const
::
google
::
protobuf
::
Message
&
message
)
override
;
private:
apollo
::
relative_map
::
MapMsg
relative_map_
;
};
}
// namespace prediction
}
// namespace apollo
#endif // MODULES_PREDICTION_CONTAINER_RELATIVE_MAP_CONTAINER_H_
modules/prediction/prediction.cc
浏览文件 @
935b9b9d
...
...
@@ -85,12 +85,17 @@ Status Prediction::Init() {
CHECK
(
AdapterManager
::
GetRelativeMap
());
}
if
(
FLAGS_use_navigation_mode
)
{
// Set relative map callback function
AdapterManager
::
AddRelativeMapCallback
(
&
Prediction
::
OnRelativeMap
,
this
);
}
else
{
// Set localization callback function
AdapterManager
::
AddLocalizationCallback
(
&
Prediction
::
OnLocalization
,
this
);
// Set planning callback function
AdapterManager
::
AddPlanningCallback
(
&
Prediction
::
OnPlanning
,
this
);
}
// Set perception obstacle callback function
AdapterManager
::
AddPerceptionObstaclesCallback
(
&
Prediction
::
RunOnce
,
this
);
// Set localization callback function
AdapterManager
::
AddLocalizationCallback
(
&
Prediction
::
OnLocalization
,
this
);
// Set planning callback function
AdapterManager
::
AddPlanningCallback
(
&
Prediction
::
OnPlanning
,
this
);
if
(
!
FLAGS_use_navigation_mode
&&
!
PredictionMap
::
Ready
())
{
return
OnError
(
"Map cannot be loaded."
);
...
...
@@ -135,6 +140,10 @@ void Prediction::OnPlanning(const planning::ADCTrajectory& adc_trajectory) {
<<
"]."
;
}
void
Prediction
::
OnRelativeMap
(
const
relative_map
::
MapMsg
&
relative_map
)
{
// TODO(kechxu): implement
}
void
Prediction
::
RunOnce
(
const
PerceptionObstacles
&
perception_obstacles
)
{
if
(
FLAGS_prediction_offline_mode
)
{
PredictOnNavigation
(
perception_obstacles
);
...
...
modules/prediction/prediction.h
浏览文件 @
935b9b9d
...
...
@@ -28,6 +28,7 @@
#include "modules/localization/proto/localization.pb.h"
#include "modules/perception/proto/perception_obstacle.pb.h"
#include "modules/planning/proto/planning.pb.h"
#include "modules/map/relative_map/proto/navigation.pb.h"
#include "modules/prediction/prediction_interface.h"
#include "modules/prediction/proto/prediction_conf.pb.h"
...
...
@@ -88,6 +89,8 @@ class Prediction : public PredictionInterface {
void
OnPlanning
(
const
planning
::
ADCTrajectory
&
adc_trajectory
);
void
OnRelativeMap
(
const
relative_map
::
MapMsg
&
relative_map
);
bool
IsValidTrajectoryPoint
(
const
::
apollo
::
common
::
TrajectoryPoint
&
trajectory_point
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录