CARLA
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Attributes | List of all members
carla::traffic_manager::SimpleWaypoint Class Reference

This is a simple wrapper class on Carla's waypoint object. More...

#include <SimpleWaypoint.h>

Public Member Functions

bool CheckIntersection () const
 Returns true if the object's waypoint belongs to an intersection (Doesn't use OpenDrive).
 
bool CheckJunction () const
 Returns true if the object's waypoint belongs to an intersection.
 
void ClearLinks ()
 Drops the links to the neighbouring waypoints (next, previous, left and right).
 
float Distance (const cg::Location &location) const
 Calculates the distance from the object's waypoint to the passed location.
 
float Distance (const SimpleWaypointPtr &other) const
 Calculates the distance the other SimpleWaypoint object.
 
float DistanceSquared (const cg::Location &location) const
 Calculates the square of the distance to given location.
 
float DistanceSquared (const SimpleWaypointPtr &other) const
 Calculates the square of the distance to other waypoints.
 
cg::Vector3D GetForwardVector () const
 Returns the vector along the waypoint's direction.
 
GeoGridId GetGeodesicGridId ()
 
uint64_t GetId () const
 Returns the unique id for the waypoint.
 
GeoGridId GetJunctionId () const
 Method to retreive junction id of the waypoint.
 
SimpleWaypointPtr GetLeftWaypoint ()
 This method is used to get the closest left waypoint for a lane change.
 
cg::Location GetLocation () const
 Returns the location object for this waypoint.
 
std::vector< SimpleWaypointPtr > GetNextWaypoint () const
 Returns the list of next waypoints.
 
std::vector< SimpleWaypointPtr > GetPreviousWaypoint () const
 Returns the list of previous waypoints.
 
SimpleWaypointPtr GetRightWaypoint ()
 This method is used to get the closest right waypoint for a lane change.
 
RoadOption GetRoadOption ()
 
cg::Transform GetTransform () const
 Return transform object for the current waypoint.
 
WaypointPtr GetWaypoint () const
 Returns a carla::shared_ptr to carla::waypoint.
 
void SetGeodesicGridId (GeoGridId _geodesic_grid_id)
 Accessor methods for geodesic grid id.
 
void SetIsJunction (bool value)
 This method is used to set whether the waypoint belongs to a junction.
 
void SetLeftWaypoint (SimpleWaypointPtr &waypoint)
 This method is used to set the closest left waypoint for a lane change.
 
uint64_t SetNextWaypoint (const std::vector< SimpleWaypointPtr > &next_waypoints)
 This method is used to set the next waypoints.
 
uint64_t SetPreviousWaypoint (const std::vector< SimpleWaypointPtr > &next_waypoints)
 This method is used to set the previous waypoints.
 
void SetRightWaypoint (SimpleWaypointPtr &waypoint)
 This method is used to set the closest right waypoint for a lane change.
 
void SetRoadOption (RoadOption _road_option)
 
 SimpleWaypoint (WaypointPtr _waypoint)
 
 ~SimpleWaypoint ()
 

Private Types

using SimpleWaypointPtr = std::shared_ptr< SimpleWaypoint >
 

Private Attributes

bool _is_junction = false
 
GeoGridId geodesic_grid_id = 0
 Integer placing the waypoint into a geodesic grid.
 
SimpleWaypointPtr next_left_waypoint
 Pointer to left lane change waypoint.
 
SimpleWaypointPtr next_right_waypoint
 Pointer to right lane change waypoint.
 
std::vector< SimpleWaypointPtr > next_waypoints
 List of pointers to next connecting waypoints.
 
std::vector< SimpleWaypointPtr > previous_waypoints
 List of pointers to previous connecting waypoints.
 
RoadOption road_option = RoadOption::Void
 RoadOption for the actual waypoint.
 
WaypointPtr waypoint
 Pointer to Carla's waypoint object around which this class wraps around.
 

Detailed Description

This is a simple wrapper class on Carla's waypoint object.

The class is used to represent discrete samples of the world map.

Definition at line 38 of file SimpleWaypoint.h.

Member Typedef Documentation

◆ SimpleWaypointPtr

Definition at line 40 of file SimpleWaypoint.h.

Constructor & Destructor Documentation

◆ SimpleWaypoint()

carla::traffic_manager::SimpleWaypoint::SimpleWaypoint ( WaypointPtr  _waypoint)

Definition at line 16 of file SimpleWaypoint.cpp.

References next_left_waypoint, next_right_waypoint, and waypoint.

◆ ~SimpleWaypoint()

carla::traffic_manager::SimpleWaypoint::~SimpleWaypoint ( )

Definition at line 21 of file SimpleWaypoint.cpp.

Member Function Documentation

◆ CheckIntersection()

bool carla::traffic_manager::SimpleWaypoint::CheckIntersection ( ) const

Returns true if the object's waypoint belongs to an intersection (Doesn't use OpenDrive).

Definition at line 118 of file SimpleWaypoint.cpp.

References next_waypoints.

◆ CheckJunction()

bool carla::traffic_manager::SimpleWaypoint::CheckJunction ( ) const

Returns true if the object's waypoint belongs to an intersection.

Definition at line 110 of file SimpleWaypoint.cpp.

References _is_junction.

◆ ClearLinks()

void carla::traffic_manager::SimpleWaypoint::ClearLinks ( )

Drops the links to the neighbouring waypoints (next, previous, left and right).

They are shared pointers that point at each other, so a graph of waypoints is freed only once they are dropped.

Definition at line 23 of file SimpleWaypoint.cpp.

References next_left_waypoint, next_right_waypoint, next_waypoints, and previous_waypoints.

◆ Distance() [1/2]

float carla::traffic_manager::SimpleWaypoint::Distance ( const cg::Location &  location) const

Calculates the distance from the object's waypoint to the passed location.

Definition at line 94 of file SimpleWaypoint.cpp.

References carla::geom::Location::Distance(), and GetLocation().

◆ Distance() [2/2]

float carla::traffic_manager::SimpleWaypoint::Distance ( const SimpleWaypointPtr &  other) const

Calculates the distance the other SimpleWaypoint object.

Definition at line 98 of file SimpleWaypoint.cpp.

References carla::geom::Location::Distance(), and GetLocation().

◆ DistanceSquared() [1/2]

float carla::traffic_manager::SimpleWaypoint::DistanceSquared ( const cg::Location &  location) const

Calculates the square of the distance to given location.

Definition at line 102 of file SimpleWaypoint.cpp.

References GetLocation().

◆ DistanceSquared() [2/2]

float carla::traffic_manager::SimpleWaypoint::DistanceSquared ( const SimpleWaypointPtr &  other) const

Calculates the square of the distance to other waypoints.

Definition at line 106 of file SimpleWaypoint.cpp.

References GetLocation().

◆ GetForwardVector()

cg::Vector3D carla::traffic_manager::SimpleWaypoint::GetForwardVector ( ) const

Returns the vector along the waypoint's direction.

Definition at line 58 of file SimpleWaypoint.cpp.

References waypoint.

◆ GetGeodesicGridId()

GeoGridId carla::traffic_manager::SimpleWaypoint::GetGeodesicGridId ( )

Definition at line 126 of file SimpleWaypoint.cpp.

References geodesic_grid_id, and waypoint.

◆ GetId()

uint64_t carla::traffic_manager::SimpleWaypoint::GetId ( ) const

Returns the unique id for the waypoint.

Definition at line 42 of file SimpleWaypoint.cpp.

References waypoint.

◆ GetJunctionId()

GeoGridId carla::traffic_manager::SimpleWaypoint::GetJunctionId ( ) const

Method to retreive junction id of the waypoint.

Definition at line 136 of file SimpleWaypoint.cpp.

References waypoint.

◆ GetLeftWaypoint()

SimpleWaypointPtr carla::traffic_manager::SimpleWaypoint::GetLeftWaypoint ( )

This method is used to get the closest left waypoint for a lane change.

Definition at line 46 of file SimpleWaypoint.cpp.

References next_left_waypoint.

◆ GetLocation()

cg::Location carla::traffic_manager::SimpleWaypoint::GetLocation ( ) const

Returns the location object for this waypoint.

Definition at line 54 of file SimpleWaypoint.cpp.

References waypoint.

Referenced by Distance(), Distance(), DistanceSquared(), DistanceSquared(), SetLeftWaypoint(), and SetRightWaypoint().

◆ GetNextWaypoint()

std::vector< SimpleWaypointPtr > carla::traffic_manager::SimpleWaypoint::GetNextWaypoint ( ) const

Returns the list of next waypoints.

Definition at line 30 of file SimpleWaypoint.cpp.

References next_waypoints.

◆ GetPreviousWaypoint()

std::vector< SimpleWaypointPtr > carla::traffic_manager::SimpleWaypoint::GetPreviousWaypoint ( ) const

Returns the list of previous waypoints.

Definition at line 34 of file SimpleWaypoint.cpp.

References previous_waypoints.

◆ GetRightWaypoint()

SimpleWaypointPtr carla::traffic_manager::SimpleWaypoint::GetRightWaypoint ( )

This method is used to get the closest right waypoint for a lane change.

Definition at line 50 of file SimpleWaypoint.cpp.

References next_right_waypoint.

◆ GetRoadOption()

RoadOption carla::traffic_manager::SimpleWaypoint::GetRoadOption ( )

Definition at line 148 of file SimpleWaypoint.cpp.

References road_option.

◆ GetTransform()

cg::Transform carla::traffic_manager::SimpleWaypoint::GetTransform ( ) const

Return transform object for the current waypoint.

Definition at line 140 of file SimpleWaypoint.cpp.

References waypoint.

◆ GetWaypoint()

WaypointPtr carla::traffic_manager::SimpleWaypoint::GetWaypoint ( ) const

Returns a carla::shared_ptr to carla::waypoint.

Definition at line 38 of file SimpleWaypoint.cpp.

References waypoint.

Referenced by carla::traffic_manager::MotionPlanStage::GetLandmarkTargetVelocity().

◆ SetGeodesicGridId()

void carla::traffic_manager::SimpleWaypoint::SetGeodesicGridId ( GeoGridId  _geodesic_grid_id)

Accessor methods for geodesic grid id.

Definition at line 122 of file SimpleWaypoint.cpp.

References geodesic_grid_id.

◆ SetIsJunction()

void carla::traffic_manager::SimpleWaypoint::SetIsJunction ( bool  value)

This method is used to set whether the waypoint belongs to a junction.

Definition at line 114 of file SimpleWaypoint.cpp.

References _is_junction.

◆ SetLeftWaypoint()

void carla::traffic_manager::SimpleWaypoint::SetLeftWaypoint ( SimpleWaypointPtr &  waypoint)

This method is used to set the closest left waypoint for a lane change.

Definition at line 76 of file SimpleWaypoint.cpp.

References GetLocation(), next_left_waypoint, waypoint, carla::geom::Vector3D::x, and carla::geom::Vector3D::y.

◆ SetNextWaypoint()

uint64_t carla::traffic_manager::SimpleWaypoint::SetNextWaypoint ( const std::vector< SimpleWaypointPtr > &  next_waypoints)

This method is used to set the next waypoints.

Definition at line 62 of file SimpleWaypoint.cpp.

References next_waypoints.

◆ SetPreviousWaypoint()

uint64_t carla::traffic_manager::SimpleWaypoint::SetPreviousWaypoint ( const std::vector< SimpleWaypointPtr > &  next_waypoints)

This method is used to set the previous waypoints.

Definition at line 69 of file SimpleWaypoint.cpp.

References previous_waypoints.

◆ SetRightWaypoint()

void carla::traffic_manager::SimpleWaypoint::SetRightWaypoint ( SimpleWaypointPtr &  waypoint)

This method is used to set the closest right waypoint for a lane change.

Definition at line 85 of file SimpleWaypoint.cpp.

References GetLocation(), next_right_waypoint, waypoint, carla::geom::Vector3D::x, and carla::geom::Vector3D::y.

◆ SetRoadOption()

void carla::traffic_manager::SimpleWaypoint::SetRoadOption ( RoadOption  _road_option)

Definition at line 144 of file SimpleWaypoint.cpp.

References road_option.

Member Data Documentation

◆ _is_junction

bool carla::traffic_manager::SimpleWaypoint::_is_junction = false
private

Definition at line 59 of file SimpleWaypoint.h.

Referenced by CheckJunction(), and SetIsJunction().

◆ geodesic_grid_id

GeoGridId carla::traffic_manager::SimpleWaypoint::geodesic_grid_id = 0
private

Integer placing the waypoint into a geodesic grid.

Definition at line 57 of file SimpleWaypoint.h.

Referenced by GetGeodesicGridId(), and SetGeodesicGridId().

◆ next_left_waypoint

SimpleWaypointPtr carla::traffic_manager::SimpleWaypoint::next_left_waypoint
private

Pointer to left lane change waypoint.

Definition at line 51 of file SimpleWaypoint.h.

Referenced by ClearLinks(), GetLeftWaypoint(), SetLeftWaypoint(), and SimpleWaypoint().

◆ next_right_waypoint

SimpleWaypointPtr carla::traffic_manager::SimpleWaypoint::next_right_waypoint
private

Pointer to right lane change waypoint.

Definition at line 53 of file SimpleWaypoint.h.

Referenced by ClearLinks(), GetRightWaypoint(), SetRightWaypoint(), and SimpleWaypoint().

◆ next_waypoints

std::vector<SimpleWaypointPtr> carla::traffic_manager::SimpleWaypoint::next_waypoints
private

List of pointers to next connecting waypoints.

Definition at line 47 of file SimpleWaypoint.h.

Referenced by CheckIntersection(), ClearLinks(), GetNextWaypoint(), and SetNextWaypoint().

◆ previous_waypoints

std::vector<SimpleWaypointPtr> carla::traffic_manager::SimpleWaypoint::previous_waypoints
private

List of pointers to previous connecting waypoints.

Definition at line 49 of file SimpleWaypoint.h.

Referenced by ClearLinks(), GetPreviousWaypoint(), and SetPreviousWaypoint().

◆ road_option

RoadOption carla::traffic_manager::SimpleWaypoint::road_option = RoadOption::Void
private

RoadOption for the actual waypoint.

Definition at line 55 of file SimpleWaypoint.h.

Referenced by GetRoadOption(), and SetRoadOption().

◆ waypoint

WaypointPtr carla::traffic_manager::SimpleWaypoint::waypoint
private

Pointer to Carla's waypoint object around which this class wraps around.

Definition at line 45 of file SimpleWaypoint.h.

Referenced by GetForwardVector(), GetGeodesicGridId(), GetId(), GetJunctionId(), GetLocation(), GetTransform(), GetWaypoint(), SetLeftWaypoint(), SetRightWaypoint(), and SimpleWaypoint().


The documentation for this class was generated from the following files: