123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- #pragma once
- #include <vector>
- #include <string>
- // 定义地图相关信息结构体
- // 定义坐标点结构体
- struct Point
- {
- // 构造函数
- Point(double x, double y, double h) : pos_x(x), pos_y(y), heading(h) {};
- double pos_x;
- double pos_y;
- double heading; // 大地坐标系,弧度
- };
- // 定义交通标牌信息结构体
- struct SignalInfo
- {
- int sign_id;
- int sign_type;
- int sign_type1;
- int sign_ref_link;
- std::vector<Point> sign_coords;
- };
- // 定义人行横道信息结构体
- struct CrosswalkInfo
- {
- int cross_id;
- std::vector<Point> cross_coords;
- };
- // 定义交通信号灯信息结构体
- struct TrafficlightInfo
- {
- int trafficlight_id;
- int trafficlight_ref_link;
- std::vector<int> trafficlight_ref_lane;
- int trafficlight_type;
- // int trafficlight_head;
- std::vector<int> trafficlight_head;
- std::vector<Point> trafficlight_coords;
- };
- // 定义路口信息结构体
- struct InterInfo
- {
- int inter_id;
- std::vector<int> inter_ref_link;
- int inter_type;
- int inter_in_shape;
- std::vector<Point> inter_coords;
- };
- // 定义车道停止线信息结构体
- struct StoplineInfo
- {
- int stopline_id;
- int stopline_ref_link;
- std::vector<int> stopline_ref_lane;
- int stopline_color;
- int stopline_type;
- std::vector<Point> stopline_coords;
- };
- // 定义道路信息结构体
- struct RoadInfo
- {
- int link_id;
- int link_fc;
- int link_type;
- int link_speed_max;
- int link_speed_min;
- int link_direction;
- int link_lanenum;
- std::vector<Point> link_coords;
- };
- // 定义车道信息结构体
- struct LaneInfo
- {
- int lane_id;
- double lane_length;
- int lane_type;
- double lane_width;
- int lane_turn;
- int lane_ref_link;
- int lane_speed_max;
- int lane_speed_min;
- std::vector<Point> lane_coords;
- };
- // 定义车道箭头信息结构体
- struct ArrowInfo
- {
- int arrow_id;
- int arrow_ref_lane;
- std::vector<int> arrow_direction;
- std::vector<Point> arrow_coords;
- };
- // 获取地图相关信息函数声明
- // 初始化函数
- bool engineInit(const std::string &folder_path);
- // 2024.10.30
- // 根据位置获取指定范围内所有路口信息
- std::vector<InterInfo> getInters(const std::string &intercsvPath, const Point &point, double distance);
- // 根据位置获取指定范围内所有人行横道信息
- std::vector<CrosswalkInfo> getCrosswalks(const std::string &crosscsvPath, const Point &point, double distance);
- // 根据位置获取前方指定范围内所有交通信号灯信息
- std::vector<TrafficlightInfo> getForwardTrafficlight(const std::string &lightcsvPath, const Point &point, double distance);
- // 根据位置获取所在道路信息
- std::vector<RoadInfo> getLink(const std::string &linkcsvPath, const Point &point);
- // 根据位置获取所在车道信息
- std::vector<LaneInfo> getLane(const std::string &lanecsvPath, const Point &point);
- // 根据位置获取指定范围内所有交通标牌信息
- std::vector<SignalInfo> getSignals(const std::string &signcsvPath, const Point &point, double distance);
- // 根据位置获取指定范围内车道停止线信息;
- std::vector<StoplineInfo> getStopline(const std::string &stoplinecsvPath, const Point &point, double distance);
- // 根据位置获取指定范围内车道箭头信息
- std::vector<ArrowInfo> getArrow(const std::string &arrowcsvPath, const Point &point, double distance);
|