提交 8cac0222 编写于 作者: K kechxu 提交者: Jiangtao Hu

Initial implement of prediction_map.cc

上级 464f474f
......@@ -41,3 +41,5 @@ DEFINE_double(still_obstacle_speed_threshold, 1.0,
"Speed threshold for still obstacles");
DEFINE_double(still_obstacle_position_std, 1.0,
"Position standard deviation for still obstacles");
// TODO(kechxu) specify the map file here
DEFINE_string(map_file, "/path/to/map_file", "Path to map file");
......@@ -35,5 +35,6 @@ DECLARE_int32(still_obstacle_history_length);
DECLARE_bool(enable_kf_tracking);
DECLARE_double(still_obstacle_speed_threshold);
DECLARE_double(still_obstacle_position_std);
DECLARE_string(map_file);
#endif // MODULES_PREDICTION_COMMON_PREDICTION_GFLAGS_H_
......@@ -11,9 +11,11 @@ cc_library(
"prediction_map.cc",
],
deps = [
"@eigen//:eigen",
"//modules/map/hdmap:hdmap",
"//modules/common:macro",
]
"//modules/prediction/common:prediction_common",
],
)
cpplint()
......@@ -15,9 +15,32 @@
*****************************************************************************/
#include "modules/prediction/map/prediction_map.h"
#include "modules/prediction/common/prediction_gflags.h"
#include "modules/map/hdmap/hdmap.h"
namespace apollo {
namespace prediction {
using apollo::hdmap::LaneInfo;
PredictionMap::PredictionMap() : hdmap_(nullptr) {
LoadMap();
}
PredictionMap::~PredictionMap() {
Clear();
}
void PredictionMap::LoadMap() {
hdmap_.reset(new apollo::hdmap::HDMapImpl());
CHECK(hdmap_ != nullptr);
hdmap_->load_map_from_file(FLAGS_map_file);
ADEBUG << "Load map file: " << FLAGS_map_file;
}
void PredictionMap::Clear() {
hdmap_.reset();
}
} // namespace prediction
} // namespace apollo
......@@ -19,6 +19,8 @@
#include <memory>
#include "Eigen/Dense"
#include "modules/common/macro.h"
#include "modules/map/hdmap/hdmap_impl.h"
......@@ -29,6 +31,13 @@ class PredictionMap {
public:
~PredictionMap();
void LoadMap();
void Clear();
Eigen::Vector2d PositionOnLane(const apollo::hdmap::LaneInfo& lane_info,
const double s);
private:
std::unique_ptr<apollo::hdmap::HDMapImpl> hdmap_;
DECLARE_SINGLETON(PredictionMap);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册