Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
1dc8f980
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,发现更多精彩内容 >>
提交
1dc8f980
编写于
7月 14, 2017
作者:
C
Calvin Miao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added pose container and enable container factory in container manager
上级
6571e1d6
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
119 addition
and
11 deletion
+119
-11
modules/prediction/container/BUILD
modules/prediction/container/BUILD
+1
-1
modules/prediction/container/container_manager.cc
modules/prediction/container/container_manager.cc
+18
-1
modules/prediction/container/container_manager.h
modules/prediction/container/container_manager.h
+7
-1
modules/prediction/container/obstacles/BUILD
modules/prediction/container/obstacles/BUILD
+0
-1
modules/prediction/container/obstacles/obstacles_container.cc
...les/prediction/container/obstacles/obstacles_container.cc
+1
-2
modules/prediction/container/obstacles/obstacles_container.h
modules/prediction/container/obstacles/obstacles_container.h
+1
-4
modules/prediction/container/pose/BUILD
modules/prediction/container/pose/BUILD
+10
-0
modules/prediction/container/pose/pose_container.cc
modules/prediction/container/pose/pose_container.cc
+25
-0
modules/prediction/container/pose/pose_container.h
modules/prediction/container/pose/pose_container.h
+52
-0
modules/prediction/prediction.cc
modules/prediction/prediction.cc
+4
-1
未找到文件。
modules/prediction/container/BUILD
浏览文件 @
1dc8f980
...
...
@@ -5,7 +5,7 @@ cc_library(
srcs
=
[
"container_manager.cc"
],
hdrs
=
[
"container_manager.h"
],
deps
=
[
"//modules/prediction/container
:
container"
,
"//modules/prediction/container
/obstacles:obstacles_
container"
,
"//modules/common:macro"
,
"@glog//:glog"
]
...
...
modules/prediction/container/container_manager.cc
浏览文件 @
1dc8f980
...
...
@@ -16,6 +16,8 @@
#include "modules/prediction/container/container_manager.h"
#include "modules/prediction/container/obstacles/obstacles_container.h"
namespace
apollo
{
namespace
prediction
{
...
...
@@ -25,7 +27,9 @@ ContainerManager::~ContainerManager() {
containers_
.
clear
();
}
void
ContainerManager
::
RegisterContainer
()
{}
void
ContainerManager
::
RegisterContainers
()
{
RegisterContainer
(
"PerceptionObstacles"
);
}
Container
*
ContainerManager
::
mutable_container
(
const
std
::
string
&
name
)
{
if
(
containers_
.
find
(
name
)
!=
containers_
.
end
())
{
...
...
@@ -35,5 +39,18 @@ Container* ContainerManager::mutable_container(const std::string& name) {
}
}
std
::
unique_ptr
<
Container
>
ContainerManager
::
CreateContainer
(
const
std
::
string
&
name
)
{
std
::
unique_ptr
<
Container
>
container_ptr
(
nullptr
);
if
(
name
==
"PerceptionObstacles"
)
{
container_ptr
.
reset
(
new
ObstaclesContainer
());
}
return
container_ptr
;
}
void
ContainerManager
::
RegisterContainer
(
const
std
::
string
&
name
)
{
containers_
[
name
]
=
CreateContainer
(
name
);
}
}
}
modules/prediction/container/container_manager.h
浏览文件 @
1dc8f980
...
...
@@ -23,6 +23,7 @@
#define MODULES_PREDICTION_CONTAINER_CONTAINER_MANAGER_H_
#include <unordered_map>
#include <string>
#include "modules/prediction/container/container.h"
#include "modules/common/macro.h"
...
...
@@ -44,7 +45,7 @@ class ContainerManager {
/**
* @brief Register all containers
*/
void
RegisterContainer
();
void
RegisterContainer
s
();
/**
* @brief Get mutable container
...
...
@@ -53,6 +54,11 @@ class ContainerManager {
*/
Container
*
mutable_container
(
const
std
::
string
&
name
);
private:
std
::
unique_ptr
<
Container
>
CreateContainer
(
const
std
::
string
&
name
);
void
RegisterContainer
(
const
std
::
string
&
name
);
private:
std
::
unordered_map
<
std
::
string
,
std
::
unique_ptr
<
Container
>>
containers_
;
...
...
modules/prediction/container/obstacles/BUILD
浏览文件 @
1dc8f980
...
...
@@ -6,7 +6,6 @@ cc_library(
hdrs
=
[
"obstacles_container.h"
],
deps
=
[
"//modules/prediction/container:container"
,
"//modules/perception/proto:perception_proto"
]
)
...
...
modules/prediction/container/obstacles/obstacles_container.cc
浏览文件 @
1dc8f980
...
...
@@ -19,8 +19,7 @@
namespace
apollo
{
namespace
prediction
{
void
ObstaclesContainer
::
Insert
(
const
::
apollo
::
perception
::
PerceptionObstacles
&
obstacles
)
{}
void
ObstaclesContainer
::
Insert
(
const
::
google
::
protobuf
::
Message
&
message
)
{}
}
}
modules/prediction/container/obstacles/obstacles_container.h
浏览文件 @
1dc8f980
...
...
@@ -24,8 +24,6 @@
#include "modules/prediction/container/container.h"
#include "modules/perception/proto/perception_obstacle.pb.h"
namespace
apollo
{
namespace
prediction
{
...
...
@@ -45,8 +43,7 @@ class ObstaclesContainer : public Container {
* @brief Insert a data message into the container
* @param Data message to be inserted in protobuf
*/
virtual
void
Insert
(
const
::
apollo
::
perception
::
PerceptionObstacles
&
obstacles
);
virtual
void
Insert
(
const
::
google
::
protobuf
::
Message
&
message
)
override
;
};
}
// namespace prediction
...
...
modules/prediction/container/pose/BUILD
0 → 100644
浏览文件 @
1dc8f980
package
(
default_visibility
=
[
"//visibility:public"
])
cc_library
(
name
=
"pose_container"
,
srcs
=
[
"pose_container.cc"
],
hdrs
=
[
"pose_container.h"
],
deps
=
[
"//modules/prediction/container:container"
,
]
)
\ No newline at end of file
modules/prediction/container/pose/pose_container.cc
0 → 100644
浏览文件 @
1dc8f980
/******************************************************************************
* 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.
*****************************************************************************/
#include "modules/prediction/container/pose/pose_container.h"
namespace
apollo
{
namespace
prediction
{
void
PoseContainer
::
Insert
(
const
::
google
::
protobuf
::
Message
&
message
)
{}
}
}
modules/prediction/container/pose/pose_container.h
0 → 100644
浏览文件 @
1dc8f980
/******************************************************************************
* 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
* @brief Obstacles container
*/
#ifndef MODULES_PREDICTION_CONTAINER_POSE_OBSTACLES_H_
#define MODULES_PREDICTION_CONTAINER_POSE_OBSTACLES_H_
#include "modules/prediction/container/container.h"
namespace
apollo
{
namespace
prediction
{
class
PoseContainer
:
public
Container
{
public:
/**
* @brief Constructor
*/
explicit
PoseContainer
()
=
default
;
/**
* @brief Destructor
*/
virtual
~
PoseContainer
()
=
default
;
/**
* @brief Insert a data message into the container
* @param Data message to be inserted in protobuf
*/
virtual
void
Insert
(
const
::
google
::
protobuf
::
Message
&
message
)
override
;
};
}
// namespace prediction
}
// namespace apollo
#endif // MODULES_PREDICTION_CONTAINER_POSE_OBSTACLES_H_
modules/prediction/prediction.cc
浏览文件 @
1dc8f980
...
...
@@ -38,12 +38,14 @@ std::string Prediction::Name() const { return FLAGS_prediction_module_name; }
Status
Prediction
::
Init
()
{
// Load prediction conf
conf_
.
Clear
();
if
(
!::
apollo
::
common
::
util
::
GetProtoFromFile
(
FLAGS_prediction_conf_file
,
&
conf_
))
{
return
OnError
(
"Unable to load prediction conf file"
+
FLAGS_prediction_conf_file
);
}
// Initialize the adapters
AdapterManager
::
instance
()
->
Init
();
CHECK
(
AdapterManager
::
GetLocalization
())
...
...
@@ -52,6 +54,7 @@ Status Prediction::Init() {
CHECK
(
AdapterManager
::
GetPerceptionObstacles
())
<<
"Perception is not ready."
;
// Set perception obstacle callback function
AdapterManager
::
SetPerceptionObstaclesCallback
(
&
Prediction
::
OnPerception
,
this
);
return
Status
::
OK
();
...
...
@@ -81,7 +84,7 @@ void Prediction::OnPerception(const PerceptionObstacles &perception_obstacles) {
ContainerManager
::
instance
()
->
mutable_container
(
"Obstacles"
)
->
Insert
(
perception_obstacles
);
EvaluatorManager
::
instance
()
->
Run
(
perception_obstacles
);
PredictorManager
::
instance
()
->
Run
(
perception_obstacles
);
// AdapterManager::PublishPrediction(
Genera
torManager::instance()->GetPredictions());
// AdapterManager::PublishPrediction(
Predic
torManager::instance()->GetPredictions());
}
Status
Prediction
::
OnError
(
const
std
::
string
&
error_msg
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录