|
CARLA
|
C++ port of agents.navigation.global_route_planner.GlobalRoutePlanner. More...
#include <GlobalRoutePlanner.h>
Classes | |
| struct | Edge |
| struct | Node |
| struct | TopologySegment |
Public Types | |
| using | RouteItem = std::pair< SharedPtr< client::Waypoint >, RoadOption > |
Public Member Functions | |
| GlobalRoutePlanner (SharedPtr< client::Map > map, double sampling_resolution) | |
| std::vector< RouteItem > | TraceRoute (const geom::Location &origin, const geom::Location &destination) |
Returns the list of (waypoint, RoadOption) pairs from origin to destination. | |
Private Types | |
| using | NodeId = int |
| using | XYZKey = std::tuple< double, double, double > |
Private Member Functions | |
| Edge & | AddEdge (NodeId n1, NodeId n2) |
| void | BuildGraph () |
| void | BuildTopology () |
| double | DistanceHeuristic (NodeId a, NodeId b) const |
| Edge * | FindEdge (NodeId n1, NodeId n2) |
| const Edge * | FindEdge (NodeId n1, NodeId n2) const |
| void | FindLooseEnds () |
| NodeId | GetOrCreateNode (const XYZKey &key) |
| void | LaneChangeLink () |
| std::optional< std::pair< NodeId, NodeId > > | Localize (const geom::Location &loc) const |
| std::vector< NodeId > | PathSearch (const geom::Location &origin, const geom::Location &destination) |
| std::pair< std::optional< NodeId >, const Edge * > | SuccessiveLastIntersectionEdge (std::size_t index, const std::vector< NodeId > &route) const |
| RoadOption | TurnDecision (std::size_t index, const std::vector< NodeId > &route) |
Static Private Member Functions | |
| static std::size_t | FindClosestInList (const SharedPtr< client::Waypoint > ¤t, const std::vector< SharedPtr< client::Waypoint > > &list) |
Private Attributes | |
| std::map< std::pair< NodeId, NodeId >, Edge > | _edges |
| std::map< XYZKey, NodeId > | _id_map |
| NodeId | _intersection_end_node = -1 |
| SharedPtr< client::Map > | _map |
| std::unordered_map< NodeId, Node > | _nodes |
| RoadOption | _previous_decision = RoadOption::Void |
| std::map< uint32_t, std::map< uint32_t, std::map< int32_t, std::pair< NodeId, NodeId > > > > | _road_id_to_edge |
| double | _sampling_resolution |
| std::vector< TopologySegment > | _topology |
C++ port of agents.navigation.global_route_planner.GlobalRoutePlanner.
Builds a directed graph from carla::client::Map::GetTopology() and runs A* search (euclidean heuristic, edge weight = length) to produce a (waypoint, RoadOption) plan between two world locations.
Definition at line 36 of file GlobalRoutePlanner.h.
|
private |
Definition at line 50 of file GlobalRoutePlanner.h.
| using carla::agents::navigation::GlobalRoutePlanner::RouteItem = std::pair<SharedPtr<client::Waypoint>, RoadOption> |
Definition at line 39 of file GlobalRoutePlanner.h.
|
private |
Definition at line 51 of file GlobalRoutePlanner.h.
| carla::agents::navigation::GlobalRoutePlanner::GlobalRoutePlanner | ( | SharedPtr< client::Map > | map, |
| double | sampling_resolution | ||
| ) |
Definition at line 56 of file GlobalRoutePlanner.cpp.
References BuildGraph(), BuildTopology(), FindLooseEnds(), and LaneChangeLink().
|
private |
Definition at line 82 of file GlobalRoutePlanner.cpp.
References _edges, _nodes, node, and carla::agents::navigation::GlobalRoutePlanner::Edge::src.
Referenced by BuildGraph(), FindLooseEnds(), and LaneChangeLink().
|
private |
Definition at line 167 of file GlobalRoutePlanner.cpp.
References _edges, _id_map, _nodes, _road_id_to_edge, _topology, AddEdge(), carla::agents::navigation::GlobalRoutePlanner::Edge::entry_vector, carla::agents::navigation::GlobalRoutePlanner::Edge::entry_waypoint, carla::agents::navigation::GlobalRoutePlanner::Edge::exit_vector, carla::agents::navigation::GlobalRoutePlanner::Edge::exit_waypoint, GetOrCreateNode(), carla::agents::navigation::GlobalRoutePlanner::Edge::intersection, carla::agents::navigation::LaneFollow, carla::agents::navigation::GlobalRoutePlanner::Edge::length, carla::agents::navigation::GlobalRoutePlanner::Edge::net_vector, carla::agents::navigation::GlobalRoutePlanner::Edge::path, road_id, carla::agents::navigation::GlobalRoutePlanner::Edge::type, and carla::agents::navigation::UnitVector().
Referenced by GlobalRoutePlanner().
|
private |
Definition at line 110 of file GlobalRoutePlanner.cpp.
References _map, _sampling_resolution, _topology, carla::agents::navigation::GlobalRoutePlanner::TopologySegment::entry, carla::agents::navigation::GlobalRoutePlanner::TopologySegment::entry_xyz, carla::agents::navigation::GlobalRoutePlanner::TopologySegment::exit, carla::agents::navigation::GlobalRoutePlanner::TopologySegment::exit_xyz, and carla::agents::navigation::GlobalRoutePlanner::TopologySegment::path.
Referenced by GlobalRoutePlanner().
|
private |
Definition at line 369 of file GlobalRoutePlanner.cpp.
References _nodes.
Referenced by PathSearch().
|
staticprivate |
Definition at line 590 of file GlobalRoutePlanner.cpp.
Referenced by TraceRoute().
|
private |
Definition at line 102 of file GlobalRoutePlanner.cpp.
References _edges.
|
private |
Definition at line 96 of file GlobalRoutePlanner.cpp.
References _edges.
Referenced by PathSearch(), SuccessiveLastIntersectionEdge(), TraceRoute(), and TurnDecision().
|
private |
Definition at line 208 of file GlobalRoutePlanner.cpp.
References _id_map, _nodes, _road_id_to_edge, _sampling_resolution, _topology, AddEdge(), carla::agents::navigation::GlobalRoutePlanner::Edge::entry_vector, carla::agents::navigation::GlobalRoutePlanner::Edge::entry_waypoint, carla::agents::navigation::GlobalRoutePlanner::Edge::exit_vector, carla::agents::navigation::GlobalRoutePlanner::Edge::exit_waypoint, carla::agents::navigation::GlobalRoutePlanner::Edge::intersection, carla::agents::navigation::LaneFollow, carla::agents::navigation::GlobalRoutePlanner::Edge::length, carla::agents::navigation::GlobalRoutePlanner::Edge::net_vector, carla::agents::navigation::GlobalRoutePlanner::Edge::path, road_id, carla::agents::navigation::GlobalRoutePlanner::Edge::type, and carla::agents::navigation::GlobalRoutePlanner::Node::vertex.
Referenced by GlobalRoutePlanner().
|
private |
Definition at line 69 of file GlobalRoutePlanner.cpp.
References _id_map, _nodes, node, and carla::agents::navigation::GlobalRoutePlanner::Node::vertex.
Referenced by BuildGraph().
|
private |
Definition at line 272 of file GlobalRoutePlanner.cpp.
References _id_map, _topology, AddEdge(), carla::agents::navigation::GlobalRoutePlanner::Edge::change_waypoint, carla::agents::navigation::ChangeLaneLeft, carla::agents::navigation::ChangeLaneRight, carla::road::Lane::Driving, carla::agents::navigation::GlobalRoutePlanner::Edge::entry_waypoint, carla::agents::navigation::GlobalRoutePlanner::Edge::exit_vector, carla::agents::navigation::GlobalRoutePlanner::Edge::exit_waypoint, carla::agents::navigation::GlobalRoutePlanner::Edge::intersection, carla::agents::navigation::GlobalRoutePlanner::Edge::length, Localize(), carla::agents::navigation::GlobalRoutePlanner::Edge::path, and carla::agents::navigation::GlobalRoutePlanner::Edge::type.
Referenced by GlobalRoutePlanner().
|
private |
Definition at line 352 of file GlobalRoutePlanner.cpp.
References _map, and _road_id_to_edge.
Referenced by LaneChangeLink(), and PathSearch().
|
private |
Definition at line 382 of file GlobalRoutePlanner.cpp.
References _nodes, DistanceHeuristic(), FindEdge(), carla::agents::navigation::GlobalRoutePlanner::Edge::length, and Localize().
Referenced by TraceRoute().
|
private |
Definition at line 450 of file GlobalRoutePlanner.cpp.
References FindEdge(), carla::agents::navigation::GlobalRoutePlanner::Edge::intersection, carla::agents::navigation::LaneFollow, and carla::agents::navigation::GlobalRoutePlanner::Edge::type.
Referenced by TurnDecision().
| std::vector< GlobalRoutePlanner::RouteItem > carla::agents::navigation::GlobalRoutePlanner::TraceRoute | ( | const geom::Location & | origin, |
| const geom::Location & | destination | ||
| ) |
Returns the list of (waypoint, RoadOption) pairs from origin to destination.
Mirrors Python trace_route.
Definition at line 610 of file GlobalRoutePlanner.cpp.
References _map, _road_id_to_edge, _sampling_resolution, carla::agents::navigation::GlobalRoutePlanner::Edge::entry_waypoint, carla::agents::navigation::GlobalRoutePlanner::Edge::exit_waypoint, FindClosestInList(), FindEdge(), carla::agents::navigation::LaneFollow, carla::agents::navigation::GlobalRoutePlanner::Edge::path, PathSearch(), TurnDecision(), carla::agents::navigation::GlobalRoutePlanner::Edge::type, and carla::agents::navigation::Void.
|
private |
Definition at line 476 of file GlobalRoutePlanner.cpp.
References _intersection_end_node, _nodes, _previous_decision, carla::agents::navigation::GlobalRoutePlanner::Edge::exit_vector, FindEdge(), carla::agents::navigation::GlobalRoutePlanner::Edge::intersection, carla::agents::navigation::LaneFollow, carla::agents::navigation::Left, carla::agents::navigation::GlobalRoutePlanner::Edge::net_vector, carla::agents::navigation::Right, carla::agents::navigation::Straight, SuccessiveLastIntersectionEdge(), carla::agents::navigation::GlobalRoutePlanner::Edge::type, and carla::agents::navigation::Void.
Referenced by TraceRoute().
|
private |
Definition at line 112 of file GlobalRoutePlanner.h.
Referenced by AddEdge(), BuildGraph(), FindEdge(), and FindEdge().
Definition at line 113 of file GlobalRoutePlanner.h.
Referenced by BuildGraph(), FindLooseEnds(), GetOrCreateNode(), and LaneChangeLink().
|
private |
Definition at line 121 of file GlobalRoutePlanner.h.
Referenced by TurnDecision().
|
private |
Definition at line 108 of file GlobalRoutePlanner.h.
Referenced by BuildTopology(), Localize(), and TraceRoute().
Definition at line 111 of file GlobalRoutePlanner.h.
Referenced by AddEdge(), BuildGraph(), DistanceHeuristic(), FindLooseEnds(), GetOrCreateNode(), PathSearch(), and TurnDecision().
|
private |
Definition at line 122 of file GlobalRoutePlanner.h.
Referenced by TurnDecision().
|
private |
Definition at line 117 of file GlobalRoutePlanner.h.
Referenced by BuildGraph(), FindLooseEnds(), Localize(), and TraceRoute().
|
private |
Definition at line 109 of file GlobalRoutePlanner.h.
Referenced by BuildTopology(), FindLooseEnds(), and TraceRoute().
|
private |
Definition at line 110 of file GlobalRoutePlanner.h.
Referenced by BuildGraph(), BuildTopology(), FindLooseEnds(), and LaneChangeLink().