25 #include <unordered_set> 28 #include "gflags/gflags.h" 29 #include "gtest/gtest_prod.h" 31 #include "modules/common/vehicle_state/proto/vehicle_state.pb.h" 32 #include "modules/routing/proto/routing.pb.h" 59 const double backward_length,
60 const double forward_length,
61 std::list<RouteSegments> *
const route_segments);
66 std::list<RouteSegments> *
const route_segments);
71 bool IsNewRouting(
const routing::RoutingResponse &routing_response)
const;
72 static bool IsNewRouting(
const routing::RoutingResponse &prev,
73 const routing::RoutingResponse &routing_response);
76 const common::PointENU &point,
double look_forward,
86 bool UpdateVehicleState(
const common::VehicleState &vehicle_state);
93 int GetWaypointIndex(
const LaneWaypoint &waypoint)
const;
95 bool GetNearestPointFromRouting(
const common::VehicleState &point,
98 bool PassageToSegments(routing::Passage passage,
101 bool ProjectToSegments(
const common::PointENU &point_enu,
105 static bool ValidateRouting(
const routing::RoutingResponse &routing);
109 std::vector<MapPathPoint> *
const points);
121 std::vector<int> GetNeighborPassages(
const routing::RoadSegment &road,
122 int start_passage)
const;
129 LaneWaypoint ToLaneWaypoint(
const routing::LaneWaypoint &waypoint)
const;
136 LaneSegment ToLaneSegment(
const routing::LaneSegment &segment)
const;
147 void UpdateNextRoutingWaypointIndex(
int cur_index);
154 int SearchForwardWaypointIndex(
int start,
const LaneWaypoint &waypoint)
const;
155 int SearchBackwardWaypointIndex(
int start,
158 void UpdateRoutingRange(
int adc_index);
161 routing::RoutingResponse routing_;
164 std::array<int, 3> index;
166 std::vector<RouteIndex> route_indices_;
167 int range_start_ = 0;
170 std::unordered_set<std::string> range_lane_ids_;
171 std::unordered_set<std::string> all_lane_ids_;
176 struct WaypointIndex {
180 : waypoint(waypoint), index(index) {}
184 int NextWaypointIndex(
int index)
const;
186 std::vector<WaypointIndex> routing_waypoint_index_;
190 std::size_t next_routing_waypoint_index_ = 0;
193 bool is_same_routing_ =
false;
198 common::VehicleState adc_state_;
202 int adc_route_index_ = -1;
216 bool stop_for_destination_ =
false;
218 FRIEND_TEST(PncMapTest, UpdateRouting);
219 FRIEND_TEST(PncMapTest, GetNearestPointFromRouting);
220 FRIEND_TEST(PncMapTest, UpdateWaypointIndex);
221 FRIEND_TEST(PncMapTest, UpdateNextRoutingWaypointIndex);
222 FRIEND_TEST(PncMapTest, GetNeighborPassages);
223 FRIEND_TEST(PncMapTest, NextWaypointIndex);
224 FRIEND_TEST(PncMapTest, SearchForwardIndex_SearchBackwardIndex);
std::vector< routing::LaneWaypoint > FutureRouteWaypoints() const
static double LookForwardDistance(const double velocity)
class RouteSegments
Definition: route_segments.h:50
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
const hdmap::HDMap * hdmap() const
bool UpdateRoutingResponse(const routing::RoutingResponse &routing_response)
bool ExtendSegments(const RouteSegments &segments, const common::PointENU &point, double look_forward, double look_backward, RouteSegments *extended_segments)
PncMap(const HDMap *hdmap)
High-precision map loader interface.
Definition: hdmap.h:53
std::shared_ptr< const LaneInfo > LaneInfoConstPtr
Definition: hdmap_common.h:125
bool IsNewRouting(const routing::RoutingResponse &routing_response) const
virtual ~PncMap()=default
DECLARE_double(look_backward_distance)
const routing::RoutingResponse & routing_response() const
bool GetRouteSegments(const common::VehicleState &vehicle_state, const double backward_length, const double forward_length, std::list< RouteSegments > *const route_segments)