| 2577 | } |
| 2578 | |
| 2579 | const ODGeomPtr ODRoad::getRefGeo(double s) const { |
| 2580 | if (ref_line.empty()) { |
| 2581 | return ODGeomPtr(nullptr); |
| 2582 | } |
| 2583 | for (const auto& _geom_ptr : ref_line) { |
| 2584 | if (s < (_geom_ptr->offset() + _geom_ptr->length())) { |
| 2585 | return _geom_ptr; |
| 2586 | } |
| 2587 | } |
| 2588 | return ref_line.back(); |
| 2589 | } |
| 2590 | |
| 2591 | void ODRoad::roadGeom(double s, double& x, double& y) const { |
| 2592 | auto _geom_ptr = getRefGeo(s); |