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