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

Method getBoundary

common/map_sdk/map_import/src/OpenDriveStruct.cpp:1496–1526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1494}
1495
1496void ODObject::getBoundary(std::vector<ODXYZ>& points,
1497 std::function<void(double s, double t, ODXYZ& P, double& T)> getP) const {
1498 points.clear();
1499 ODXYZ P;
1500 double T = 0;
1501 getP(s, t, P, T);
1502 points.reserve(4);
1503 std::vector<ODXYZ> pts;
1504 if (width < 1e-6 && length < 1e-6) {
1505 pts.push_back(ODXYZ(0, 0));
1506 if (height > 1e-6) {
1507 pts.push_back(ODXYZ(0, 0, height));
1508 }
1509 } else if (width > 1e-6 && length < 1e-6) {
1510 pts.push_back(ODXYZ(0, -width * 0.5, 0));
1511 pts.push_back(ODXYZ(0, width * 0.5, 0));
1512 } else if (width < 1e-6 && length > 1e-6) {
1513 pts.push_back(ODXYZ(-length * 0.5, 0));
1514 pts.push_back(ODXYZ(length * 0.5, 0));
1515 } else {
1516 pts.push_back(ODXYZ(-length * 0.5, -width * 0.5));
1517 pts.push_back(ODXYZ(length * 0.5, -width * 0.5));
1518 pts.push_back(ODXYZ(length * 0.5, width * 0.5));
1519 pts.push_back(ODXYZ(-length * 0.5, width * 0.5));
1520 }
1521
1522 for (const auto& p : pts) {
1523 ODXYZ np = ODRPY(T) * (ODRPY(hdg, roll, pitch) * p) + P + ODXYZ(0, 0, zoffset);
1524 points.push_back(np);
1525 }
1526}
1527
1528void ODObject::getRepeateBoundarys(std::vector<std::vector<ODXYZ>>& points,
1529 std::function<void(double s, double t, ODXYZ& P, double& T)> getP) {

Callers 2

getObjectsMethod · 0.80
getBoundariesMethod · 0.80

Calls 5

ODXYZClass · 0.85
ODRPYClass · 0.85
reserveMethod · 0.80
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected