CARLA
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>

+ Collaboration diagram for carla::traffic_manager::SimpleWaypoint:

Public Member Functions

bool CheckIntersection () const
 Returns true if the object's waypoint belongs to an intersection (Doesn't use OpenDrive). More...
 
bool CheckJunction () const
 Returns true if the object's waypoint belongs to an intersection. More...
 
float Distance (const cg::Location &location) const
 Calculates the distance from the object's waypoint to the passed location. More...
 
float Distance (const SimpleWaypointPtr &other) const
 Calculates the distance the other SimpleWaypoint object. More...
 
float DistanceSquared (const cg::Location &location) const
 Calculates the square of the distance to given location. More...
 
float DistanceSquared (const SimpleWaypointPtr &other) const
 Calculates the square of the distance to other waypoints. More...
 
cg::Vector3D GetForwardVector () const
 Returns the vector along the waypoint's direction. More...
 
GeoGridId GetGeodesicGridId ()
 
uint64_t GetId () const
 Returns the unique id for the waypoint. More...
 
GeoGridId GetJunctionId () const
 Method to retreive junction id of the waypoint. More...
 
SimpleWaypointPtr GetLeftWaypoint ()
 This method is used to get the closest left waypoint for a lane change. More...
 
cg::Location GetLocation () const
 Returns the location object for this waypoint. More...
 
std::vector< SimpleWaypointPtrGetNextWaypoint () const
 Returns the list of next waypoints. More...
 
std::vector< SimpleWaypointPtrGetPreviousWaypoint () const
 Returns the list of previous waypoints. More...
 
SimpleWaypointPtr GetRightWaypoint ()
 This method is used to get the closest right waypoint for a lane change. More...
 
RoadOption GetRoadOption ()
 
cg::Transform GetTransform () const
 Return transform object for the current waypoint. More...
 
WaypointPtr GetWaypoint () const
 Returns a carla::shared_ptr to carla::waypoint. More...
 
void SetGeodesicGridId (GeoGridId _geodesic_grid_id)
 Accessor methods for geodesic grid id. More...
 
void SetIsJunction (bool value)
 This method is used to set whether the waypoint belongs to a junction. More...
 
void SetLeftWaypoint (SimpleWaypointPtr &waypoint)
 This method is used to set the closest left waypoint for a lane change. More...
 
uint64_t SetNextWaypoint (const std::vector< SimpleWaypointPtr > &next_waypoints)
 This method is used to set the next waypoints. More...
 
uint64_t SetPreviousWaypoint (const std::vector< SimpleWaypointPtr > &next_waypoints)
 This method is used to set the previous waypoints. More...
 
void SetRightWaypoint (SimpleWaypointPtr &waypoint)
 This method is used to set the closest right waypoint for a lane change. More...
 
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. More...
 
SimpleWaypointPtr next_left_waypoint
 Pointer to left lane change waypoint. More...
 
SimpleWaypointPtr next_right_waypoint
 Pointer to right lane change waypoint. More...
 
std::vector< SimpleWaypointPtrnext_waypoints
 List of pointers to next connecting waypoints. More...
 
std::vector< SimpleWaypointPtrprevious_waypoints
 List of pointers to previous connecting waypoints. More...
 
RoadOption road_option = RoadOption::Void
 RoadOption for the actual waypoint. More...
 
WaypointPtr waypoint
 Pointer to Carla's waypoint object around which this class wraps around. More...
 

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 111 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 103 of file SimpleWaypoint.cpp.

References _is_junction.

◆ 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 87 of file SimpleWaypoint.cpp.

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

+ Here is the call graph for this function:

◆ Distance() [2/2]

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

Calculates the distance the other SimpleWaypoint object.

Definition at line 91 of file SimpleWaypoint.cpp.

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

+ Here is the call graph for this function:

◆ 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 95 of file SimpleWaypoint.cpp.

References carla::geom::Math::DistanceSquared(), and GetLocation().

+ Here is the call graph for this function:

◆ 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 99 of file SimpleWaypoint.cpp.

References carla::geom::Math::DistanceSquared(), and GetLocation().

+ Here is the call graph for this function:

◆ GetForwardVector()

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

Returns the vector along the waypoint's direction.

Definition at line 51 of file SimpleWaypoint.cpp.

References waypoint.

◆ GetGeodesicGridId()

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

Definition at line 119 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 35 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 129 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 39 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 47 of file SimpleWaypoint.cpp.

References waypoint.

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

+ Here is the caller graph for this function:

◆ GetNextWaypoint()

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

Returns the list of next waypoints.

Definition at line 23 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 27 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 43 of file SimpleWaypoint.cpp.

References next_right_waypoint.

◆ GetRoadOption()

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

Definition at line 141 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 133 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 31 of file SimpleWaypoint.cpp.

References waypoint.

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

+ Here is the caller graph for this function:

◆ SetGeodesicGridId()

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

Accessor methods for geodesic grid id.

Definition at line 115 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 107 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 69 of file SimpleWaypoint.cpp.

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

+ Here is the call graph for this function:

◆ 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 55 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 62 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 78 of file SimpleWaypoint.cpp.

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

+ Here is the call graph for this function:

◆ SetRoadOption()

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

Definition at line 137 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 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 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(), 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 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: