| | |
| | | |
| | | // 一组平行的分道线 |
| | | typedef struct { |
| | | std::vector<lane_direct_t> lane_direct; // 每一车道的运行方向 |
| | | std::vector<lane_direct_t> lane_direct; // 一组导向线的配置 |
| | | std::vector<std::vector<segment_t>> lines; // 每段域下的平行的一组线 |
| | | } separate_t; |
| | | |
| | |
| | | #include "stop_car.h" |
| | | #include "operate_gear.h" |
| | | |
| | | #include <cmath> |
| | | #include <vector> |
| | | #include <list> |
| | | #include <map> |
| | |
| | | return false; |
| | | } |
| | | |
| | | static int GetGuideDirect(road_exam_map &RoadMap, PointF point, int roadIndex, int sepIndex, int laneNo) |
| | | { |
| | | for (int i = 0; i < RoadMap.roads[roadIndex].separate[sepIndex].lane_direct.size(); ++i) { |
| | | double d1 = CalcDistanceReference(point, RoadMap.roads[roadIndex].separate[sepIndex].lane_direct[i].start, RoadMap.roads[roadIndex].rightEdge); |
| | | double d2 = CalcDistanceReference(point, RoadMap.roads[roadIndex].separate[sepIndex].lane_direct[i].end, RoadMap.roads[roadIndex].rightEdge); |
| | | if (fabs(d1) < 1e-6 && d1 < 0.0 && d2 > 1e-6 && laneNo < RoadMap.roads[roadIndex].separate[sepIndex].lane_direct[i].direct.size()) { |
| | | return RoadMap.roads[roadIndex].separate[sepIndex].lane_direct[i].direct[laneNo]; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | /******************************************** |
| | | * 计算某点在哪个车道 |
| | | * @param point |