12 namespace traffic_manager {
48 return waypoint->GetTransform().location;
52 return waypoint->GetTransform().rotation.GetForwardVector();
56 for (
auto &simple_waypoint: waypoints) {
59 return static_cast<uint64_t
>(waypoints.size());
63 for (
auto &simple_waypoint: waypoints) {
66 return static_cast<uint64_t
>(waypoints.size());
73 if ((heading_vector.
x * relative_vector.
y - heading_vector.
y * relative_vector.
x) > 0.0f) {
82 if ((heading_vector.
x * relative_vector.
y - heading_vector.
y * relative_vector.
x) < 0.0f) {
122 grid_id =
waypoint->GetJunctionId();
void SetIsJunction(bool value)
This method is used to set whether the waypoint belongs to a junction.
SimpleWaypointPtr next_right_waypoint
Pointer to right lane change waypoint.
uint64_t SetNextWaypoint(const std::vector< SimpleWaypointPtr > &next_waypoints)
This method is used to set the next waypoints.
SimpleWaypointPtr next_left_waypoint
Pointer to left lane change waypoint.
cg::Vector3D GetForwardVector() const
Returns the vector along the waypoint's direction.
void SetLeftWaypoint(SimpleWaypointPtr &waypoint)
This method is used to set the closest left waypoint for a lane change.
WaypointPtr waypoint
Pointer to Carla's waypoint object around which this class wraps around.
float DistanceSquared(const cg::Location &location) const
Calculates the square of the distance to given location.
This file contains definitions of common data structures used in traffic manager. ...
SimpleWaypointPtr GetRightWaypoint()
This method is used to get the closest right waypoint for a lane change.
static auto DistanceSquared(const Vector3D &a, const Vector3D &b)
SimpleWaypoint(WaypointPtr _waypoint)
void SetRoadOption(RoadOption _road_option)
std::vector< SimpleWaypointPtr > GetPreviousWaypoint() const
Returns the list of previous waypoints.
bool CheckJunction() const
Returns true if the object's waypoint belongs to an intersection.
std::vector< SimpleWaypointPtr > previous_waypoints
List of pointers to previous connecting waypoints.
uint64_t GetId() const
Returns the unique id for the waypoint.
uint64_t SetPreviousWaypoint(const std::vector< SimpleWaypointPtr > &next_waypoints)
This method is used to set the previous waypoints.
bool CheckIntersection() const
Returns true if the object's waypoint belongs to an intersection (Doesn't use OpenDrive).
std::shared_ptr< SimpleWaypoint > SimpleWaypointPtr
carla::SharedPtr< cc::Waypoint > WaypointPtr
cg::Transform GetTransform() const
Return transform object for the current waypoint.
GeoGridId GetJunctionId() const
Method to retreive junction id of the waypoint.
std::vector< SimpleWaypointPtr > GetNextWaypoint() const
Returns the list of next waypoints.
cg::Location GetLocation() const
Returns the location object for this waypoint.
float Distance(const cg::Location &location) const
Calculates the distance from the object's waypoint to the passed location.
GeoGridId GetGeodesicGridId()
std::shared_ptr< SimpleWaypoint > SimpleWaypointPtr
auto Distance(const Location &loc) const
RoadOption GetRoadOption()
SimpleWaypointPtr GetLeftWaypoint()
This method is used to get the closest left waypoint for a lane change.
std::vector< SimpleWaypointPtr > next_waypoints
List of pointers to next connecting waypoints.
RoadOption road_option
RoadOption for the actual waypoint.
void SetRightWaypoint(SimpleWaypointPtr &waypoint)
This method is used to set the closest right waypoint for a lane change.
void SetGeodesicGridId(GeoGridId _geodesic_grid_id)
Accessor methods for geodesic grid id.
WaypointPtr GetWaypoint() const
Returns a carla::shared_ptr to carla::waypoint.
GeoGridId geodesic_grid_id
Integer placing the waypoint into a geodesic grid.