44 #include <ilqgames/geometry/polyline2.h> 45 #include <ilqgames/utils/initialize_along_route.h> 46 #include <ilqgames/utils/operating_point.h> 47 #include <ilqgames/utils/types.h> 49 #include <glog/logging.h> 55 void InitializeAlongRoute(
const Polyline2& route,
float initial_route_pos,
57 const std::pair<Dimension, Dimension>& position_dims,
58 OperatingPoint* operating_point) {
59 CHECK_NOTNULL(operating_point);
60 CHECK(!operating_point->xs.empty());
61 CHECK_GT(operating_point->xs[0].size(), 0);
64 for (
size_t kk = 0; kk < operating_point->xs.size(); kk++) {
65 const float route_pos = initial_route_pos + nominal_speed *
66 static_cast<Time
>(kk) *
69 const Point2 route_pt = route.PointAt(route_pos);
70 operating_point->xs[kk](position_dims.first) = route_pt.x();
71 operating_point->xs[kk](position_dims.second) = route_pt.y();