MCPcopy Create free account
hub / github.com/Tencent/TAD_Sim / searchPath

Method searchPath

common/map_sdk/route_plan/src/route_plan.cpp:67–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65RoutePlan::~RoutePlan() {}
66
67bool RoutePlan::searchPath(std::vector<txPoint>& dsts, RoadInfoArray& traj) {
68 if (dataInsPtr->cloudFlag) return false;
69
70 int32_t r = dataInsPtr->planerPtr->searchTrajectory(dsts, traj);
71 if (r != 0) {
72 txlog::info("search trajectory failed!");
73 return false;
74 } else {
75 const int minPathSize = (traj.size() > 64 ? traj.size() + 1 : 64);
76 char* info = new char[minPathSize * 32];
77 sprintf(info, "Trajectory Size: %s", std::to_string(traj.size()).c_str());
78 txlog::info(info);
79 sprintf(info, "Trajectory Result: \n");
80 char trajId[32];
81 for (size_t i = 0; i < traj.size(); ++i) {
82 if (traj[i].roadId > 0) {
83 sprintf(trajId, "%s ", std::to_string(traj[i].roadId).c_str());
84 } else {
85 sprintf(trajId, "%s-%s", std::to_string(traj[i].roadId).c_str(), std::to_string(traj[i].attribute).c_str());
86 switch (traj[i].attribute) {
87 case U_TURN:
88 strcat(trajId, "U ");
89 break;
90 case STRAIGHT:
91 strcat(trajId, "S ");
92 break;
93 case TURN_LEFT:
94 strcat(trajId, "L ");
95 break;
96 case TURN_RIGHT:
97 strcat(trajId, "R ");
98 break;
99 case LEFT_WITH_TRAFFIC_LIGHT:
100 strcat(trajId, "LwL ");
101 break;
102 case STRAIGHT_WITH_TRAFFIC_LIGHT:
103 strcat(trajId, "SwL ");
104 break;
105 case RIGHT_WITH_TRAFFIC_LIGHT:
106 strcat(trajId, "RwL ");
107 break;
108 case U_TURN_WITH_TRAFFIC_LIGHT:
109 strcat(trajId, "UwL ");
110 break;
111 }
112 }
113 strcat(info, trajId);
114 }
115 txlog::info(info);
116 delete[] info;
117 info = NULL;
118 }
119 return true;
120}
121
122bool RoutePlan::searchPath(std::vector<txPoint>& dsts, hadmap::txRoute& traj) {
123 if (dataInsPtr->cloudFlag) {

Callers

nothing calls this directly

Calls 13

infoFunction · 0.85
to_stringFunction · 0.85
generatePostJsonFunction · 0.85
searchTrajectoryMethod · 0.80
urlMethod · 0.80
postMethod · 0.80
setLengthMethod · 0.80
setIdMethod · 0.80
sizeMethod · 0.45
getRouteMethod · 0.45
locationMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected