diff --git a/modules/prediction/container/obstacles/obstacle.cc b/modules/prediction/container/obstacles/obstacle.cc index 6cf6b77989cc24a24859b582842badde88d3cc9f..a6b384c65b1c6f4df5d912ce6baf30dc0d71c90c 100644 --- a/modules/prediction/container/obstacles/obstacle.cc +++ b/modules/prediction/container/obstacles/obstacle.cc @@ -19,12 +19,27 @@ namespace apollo { namespace prediction { -Obstacle::Obstacle() { +using apollo::perception::PerceptionObstacle; + +std::mutex Obstacle::_mutex; + +Obstacle::Obstacle() : + id_(-1), + type_(PerceptionObstacle::UNKNOWN_MOVABLE), + feature_history_(0), + kf_motion_tracker_(), + is_motion_tracker_enabled_(false), + kf_lane_tracker_map_(0) { } Obstacle::~Obstacle() { - + id_ = -1; + type_ = PerceptionObstacle::UNKNOWN_UNMOVABLE; + feature_history_.clear(); + is_motion_tracker_enabled_ = false; + kf_lane_tracker_map_.clear(); + // TODO(author) current_lanes_.clear(); } void Obstacle::Insert( diff --git a/modules/prediction/container/obstacles/obstacle.h b/modules/prediction/container/obstacles/obstacle.h index 4d59f75c6f097e022204acea85f3cb281f31c05b..21c15125feca5582a52a49bd55b28da088aca92b 100644 --- a/modules/prediction/container/obstacles/obstacle.h +++ b/modules/prediction/container/obstacles/obstacle.h @@ -51,9 +51,10 @@ class Obstacle { apollo::perception::PerceptionObstacle::Type type_; std::deque feature_history_; apollo::common::math::KalmanFilter kf_motion_tracker_; - bool is_motion_tracker_enabled; + bool is_motion_tracker_enabled_; std::unordered_map> kf_lane_tracker_; + apollo::common::math::KalmanFilter> kf_lane_tracker_map_; + // TODO(author) std::vector _current_lanes; static std::mutex _mutex; };