提交 02e9dbb8 编写于 作者: C Calvin Miao

Added predictor framework

上级 6216d2a4
...@@ -10,6 +10,7 @@ cc_library( ...@@ -10,6 +10,7 @@ cc_library(
"//modules/common:log", "//modules/common:log",
"//modules/common/adapters:adapter_manager", "//modules/common/adapters:adapter_manager",
"//modules/prediction/container:container_manager", "//modules/prediction/container:container_manager",
"//modules/prediction/predictor:predictor_manager",
"//modules/perception/proto:perception_proto", "//modules/perception/proto:perception_proto",
"//modules/prediction/common:prediction_common", "//modules/prediction/common:prediction_common",
"//modules/prediction/proto:prediction_proto", "//modules/prediction/proto:prediction_proto",
......
...@@ -53,4 +53,4 @@ class Container { ...@@ -53,4 +53,4 @@ class Container {
} // namespace prediction } // namespace prediction
} // namespace apollo } // namespace apollo
#endif // MODULES_PREDICTION_CONTAINER_CONTAINER_MANAGER_H_ #endif // MODULES_PREDICTION_CONTAINER_CONTAINER_H_
...@@ -49,7 +49,7 @@ class ContainerManager { ...@@ -49,7 +49,7 @@ class ContainerManager {
/** /**
* @brief Get mutable container * @brief Get mutable container
* @param Name of the container * @param Name of the container
* @return Pointer of the container given the name * @return Pointer to the container given the name
*/ */
Container* mutable_container(const std::string& name); Container* mutable_container(const std::string& name);
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "modules/common/adapters/adapter_manager.h" #include "modules/common/adapters/adapter_manager.h"
#include "modules/prediction/container/container_manager.h" #include "modules/prediction/container/container_manager.h"
#include "modules/prediction/predictor/predictor_manager.h"
#include "modules/prediction/common/prediction_gflags.h" #include "modules/prediction/common/prediction_gflags.h"
namespace apollo { namespace apollo {
...@@ -63,6 +64,9 @@ void Prediction::OnPerception(const PerceptionObstacles &perception_obstacles) { ...@@ -63,6 +64,9 @@ void Prediction::OnPerception(const PerceptionObstacles &perception_obstacles) {
ContainerManager::instance()->mutable_container("Pose")->Insert(localization); ContainerManager::instance()->mutable_container("Pose")->Insert(localization);
} }
ContainerManager::instance()->mutable_container("Obstacles")->Insert(perception_obstacles); ContainerManager::instance()->mutable_container("Obstacles")->Insert(perception_obstacles);
PredictorManager::instance()->Run(perception_obstacles);
// GeneratorManager::instance()->Run(perception_obstacles);
// AdapterManager::PublishPrediction(GeneratorManager::instance()->GetPredictions());
} }
} // namespace prediction } // namespace prediction
......
package(default_visibility = ["//visibility:public"])
cc_library(
name = "predictor_manager",
srcs = ["predictor_manager.cc"],
hdrs = ["predictor_manager.h"],
deps = [
"//modules/prediction/predictor:predictor",
"//modules/perception/proto:perception_proto",
"//modules/common:macro",
"@glog//:glog"
]
)
cc_library(
name = "predictor",
hdrs = ["predictor.h"],
deps = [
]
)
\ No newline at end of file
/******************************************************************************
* 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 Define the data container base class
*/
#ifndef MODULES_PREDICTION_PREDICTOR_PREDICTOR_H_
#define MODULES_PREDICTION_PREDICTOR_PREDICTOR_H_
#include <google/protobuf/message.h>
/**
* @namespace apollo::prediction
* @brief apollo::prediction
*/
namespace apollo {
namespace prediction {
class Predictor {
public:
/**
* @brief Constructor
*/
Predictor() = default;
/**
* @brief Destructor
*/
virtual ~Predictor() = default;
};
} // namespace prediction
} // namespace apollo
#endif // MODULES_PREDICTION_PREDICTOR_PREDICTOR_H_
/******************************************************************************
* 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/predictor/predictor_manager.h"
namespace apollo {
namespace prediction {
PredictorManager::PredictorManager() {}
const Predictor* PredictorManager::GetPredictor() {
return nullptr;
}
void PredictorManager::Run(
const ::apollo::perception::PerceptionObstacles& perception_obstacles) {}
}
}
/******************************************************************************
* 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 Use predictor manager to manage all predictors
*/
#ifndef MODULES_PREDICTION_PREDICTOR_PREDICTOR_MANAGER_H_
#define MODULES_PREDICTION_PREDICTOR_PREDICTOR_MANAGER_H_
#include <unordered_map>
#include "modules/prediction/predictor/predictor.h"
#include "modules/perception/proto/perception_obstacle.pb.h"
#include "modules/common/macro.h"
/**
* @namespace apollo::prediction
* @brief apollo::prediction
*/
namespace apollo {
namespace prediction {
class PredictorManager {
public:
/**
* @brief Destructor
*/
virtual ~PredictorManager() = default;
/**
* @brief Get predictor
* @return Pointer to the predictor
*/
const Predictor* GetPredictor();
void Run(const ::apollo::perception::PerceptionObstacles& perception_obstacles);
DECLARE_SINGLETON(PredictorManager)
};
} // namespace prediction
} // namespace apollo
#endif // MODULES_PREDICTION_PREDICTOR_PREDICTOR_MANAGER_H_
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册