CARLA
Loading...
Searching...
No Matches
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()

Definition at line 16 of file SimpleWaypoint.cpp.

◆ ~SimpleWaypoint()

Member Function Documentation

◆ CheckIntersection()

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

Definition at line 118 of file SimpleWaypoint.cpp.

◆ CheckJunction()

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

Definition at line 110 of file SimpleWaypoint.cpp.

◆ 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.

◆ Distance() [1/2]

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

Definition at line 94 of file SimpleWaypoint.cpp.

◆ Distance() [2/2]

Calculates the distance the other SimpleWaypoint object.

Definition at line 98 of file SimpleWaypoint.cpp.

◆ DistanceSquared() [1/2]

Calculates the square of the distance to given location.

Definition at line 102 of file SimpleWaypoint.cpp.

◆ DistanceSquared() [2/2]

Calculates the square of the distance to other waypoints.

Definition at line 106 of file SimpleWaypoint.cpp.

◆ GetForwardVector()

Returns the vector along the waypoint's direction.

Definition at line 58 of file SimpleWaypoint.cpp.

◆ GetGeodesicGridId()

◆ GetId()

Returns the unique id for the waypoint.

Definition at line 42 of file SimpleWaypoint.cpp.

◆ GetJunctionId()

Method to retreive junction id of the waypoint.

Definition at line 136 of file SimpleWaypoint.cpp.

◆ GetLeftWaypoint()

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

Definition at line 46 of file SimpleWaypoint.cpp.

◆ GetLocation()

Returns the location object for this waypoint.

Definition at line 54 of file SimpleWaypoint.cpp.

◆ GetNextWaypoint()

Returns the list of next waypoints.

Definition at line 30 of file SimpleWaypoint.cpp.

◆ GetPreviousWaypoint()

Returns the list of previous waypoints.

Definition at line 34 of file SimpleWaypoint.cpp.

◆ GetRightWaypoint()

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

Definition at line 50 of file SimpleWaypoint.cpp.

◆ GetRoadOption()

◆ GetTransform()

Return transform object for the current waypoint.

Definition at line 140 of file SimpleWaypoint.cpp.

◆ GetWaypoint()

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

Definition at line 38 of file SimpleWaypoint.cpp.

◆ 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.

◆ SetIsJunction()

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

Definition at line 114 of file SimpleWaypoint.cpp.

◆ SetLeftWaypoint()

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

Definition at line 76 of file SimpleWaypoint.cpp.

◆ 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.

◆ 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.

◆ SetRightWaypoint()

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

Definition at line 85 of file SimpleWaypoint.cpp.

◆ SetRoadOption()

Definition at line 144 of file SimpleWaypoint.cpp.

Member Data Documentation

◆ _is_junction

Definition at line 59 of file SimpleWaypoint.h.

◆ geodesic_grid_id

Integer placing the waypoint into a geodesic grid.

Definition at line 57 of file SimpleWaypoint.h.

◆ next_left_waypoint

Pointer to left lane change waypoint.

Definition at line 51 of file SimpleWaypoint.h.

◆ next_right_waypoint

Pointer to right lane change waypoint.

Definition at line 53 of file SimpleWaypoint.h.

◆ next_waypoints

List of pointers to next connecting waypoints.

Definition at line 47 of file SimpleWaypoint.h.

◆ previous_waypoints

List of pointers to previous connecting waypoints.

Definition at line 49 of file SimpleWaypoint.h.

◆ 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.

◆ waypoint

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

Definition at line 45 of file SimpleWaypoint.h.


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