20 #include <unordered_map> 22 #include "opencv2/opencv.hpp" 25 #include "modules/prediction/proto/feature.pb.h" 28 namespace prediction {
39 const std::unordered_map<int, ObstacleHistory>& obstacle_id_history_map);
41 bool GetMapById(
const int obstacle_id, cv::Mat* feature_map);
44 cv::Point2i GetTransPoint(
const double x,
const double y,
const double base_x,
45 const double base_y) {
46 return cv::Point2i(static_cast<int>((x - base_x) / 0.1),
47 static_cast<int>(2000 - (y - base_y) / 0.1));
50 void DrawBaseMap(
const double x,
const double y,
const double base_x,
53 void DrawBaseMapThread();
55 void DrawRoads(
const common::PointENU& center_point,
const double base_x,
57 const cv::Scalar& color = cv::Scalar(64, 64, 64));
59 void DrawJunctions(
const common::PointENU& center_point,
const double base_x,
61 const cv::Scalar& color = cv::Scalar(128, 128, 128));
63 void DrawCrosswalks(
const common::PointENU& center_point,
const double base_x,
65 const cv::Scalar& color = cv::Scalar(192, 192, 192));
67 void DrawLanes(
const common::PointENU& center_point,
const double base_x,
69 const cv::Scalar& color = cv::Scalar(255, 255, 255));
71 cv::Scalar HSVtoRGB(
double H = 1.0,
double S = 1.0,
double V = 1.0);
73 void DrawRect(
const Feature& feature,
const cv::Scalar& color,
74 const double base_x,
const double base_y, cv::Mat* img);
76 void DrawPoly(
const Feature& feature,
const cv::Scalar& color,
77 const double base_x,
const double base_y, cv::Mat* img);
79 void DrawHistory(
const ObstacleHistory& history,
const cv::Scalar& color,
80 const double base_x,
const double base_y, cv::Mat* img);
82 cv::Mat CropArea(
const cv::Mat& input_img,
const cv::Point2i& center_point,
83 const double heading);
85 cv::Mat CropByHistory(
const ObstacleHistory& history,
const cv::Scalar& color,
86 const double base_x,
const double base_y);
94 std::mutex draw_base_map_thread_mutex_;
98 double curr_base_x_ = 0.0;
99 double curr_base_y_ = 0.0;
101 std::unordered_map<int, ObstacleHistory> obstacle_id_history_map_;
102 Feature ego_feature_;
104 std::future<void> task_future_;
106 bool started_drawing_ =
false;
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: semantic_map.h:30
virtual ~SemanticMap()=default
void RunCurrFrame(const std::unordered_map< int, ObstacleHistory > &obstacle_id_history_map)
bool GetMapById(const int obstacle_id, cv::Mat *feature_map)