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). 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< SimpleWaypointPtr > | GetNextWaypoint () const |
Returns the list of next waypoints. More... | |
std::vector< SimpleWaypointPtr > | GetPreviousWaypoint () 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< SimpleWaypointPtr > | next_waypoints |
List of pointers to next connecting waypoints. More... | |
std::vector< SimpleWaypointPtr > | previous_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... | |
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.
|
private |
Definition at line 40 of file SimpleWaypoint.h.
carla::traffic_manager::SimpleWaypoint::SimpleWaypoint | ( | WaypointPtr | _waypoint | ) |
Definition at line 16 of file SimpleWaypoint.cpp.
References next_left_waypoint, next_right_waypoint, and waypoint.
carla::traffic_manager::SimpleWaypoint::~SimpleWaypoint | ( | ) |
Definition at line 21 of file SimpleWaypoint.cpp.
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.
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.
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().
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().
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().
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().
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.
GeoGridId carla::traffic_manager::SimpleWaypoint::GetGeodesicGridId | ( | ) |
Definition at line 119 of file SimpleWaypoint.cpp.
References geodesic_grid_id, and waypoint.
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.
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.
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.
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().
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.
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.
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.
RoadOption carla::traffic_manager::SimpleWaypoint::GetRoadOption | ( | ) |
Definition at line 141 of file SimpleWaypoint.cpp.
References road_option.
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.
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().
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.
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.
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.
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.
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.
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.
void carla::traffic_manager::SimpleWaypoint::SetRoadOption | ( | RoadOption | _road_option | ) |
Definition at line 137 of file SimpleWaypoint.cpp.
References road_option.
|
private |
Definition at line 59 of file SimpleWaypoint.h.
Referenced by CheckJunction(), and SetIsJunction().
|
private |
Integer placing the waypoint into a geodesic grid.
Definition at line 57 of file SimpleWaypoint.h.
Referenced by GetGeodesicGridId(), and SetGeodesicGridId().
|
private |
Pointer to left lane change waypoint.
Definition at line 51 of file SimpleWaypoint.h.
Referenced by GetLeftWaypoint(), SetLeftWaypoint(), and SimpleWaypoint().
|
private |
Pointer to right lane change waypoint.
Definition at line 53 of file SimpleWaypoint.h.
Referenced by GetRightWaypoint(), SetRightWaypoint(), and SimpleWaypoint().
|
private |
List of pointers to next connecting waypoints.
Definition at line 47 of file SimpleWaypoint.h.
Referenced by CheckIntersection(), GetNextWaypoint(), and SetNextWaypoint().
|
private |
List of pointers to previous connecting waypoints.
Definition at line 49 of file SimpleWaypoint.h.
Referenced by GetPreviousWaypoint(), and SetPreviousWaypoint().
|
private |
RoadOption for the actual waypoint.
Definition at line 55 of file SimpleWaypoint.h.
Referenced by GetRoadOption(), and SetRoadOption().
|
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().