CARLA
Public Member Functions | Private Attributes | List of all members
UOpenDriveMap Class Reference

Helper class for exposing CARLA OpenDrive API to blueprints. More...

#include <OpenDriveMap.h>

+ Inheritance diagram for UOpenDriveMap:
+ Collaboration diagram for UOpenDriveMap:

Public Member Functions

FVector ComputeLocation (FWaypoint Waypoint) const
 Compute the location of a waypoint. More...
 
TArray< FVector > ComputeLocations (const TArray< FWaypoint > &Waypoints) const
 Compute the locations of an array of waypoints. More...
 
FTransform ComputeTransform (FWaypoint Waypoint) const
 Compute the transform of a waypoint. More...
 
TArray< FTransform > ComputeTransforms (const TArray< FWaypoint > &Waypoints) const
 Compute the transforms of an array of waypoints. More...
 
TArray< FWaypointConnectionGenerateTopology () const
 Generate the minimum set of waypoints that define the topology of this map. More...
 
TArray< FWaypointGenerateWaypoints (float ApproxDistance=100.0f) const
 Generate waypoints all over the map at an approximated distance. More...
 
TArray< FWaypointGenerateWaypointsOnRoadEntries () const
 Generate waypoints on each lane at the start of each road. More...
 
FWaypoint GetClosestWaypointOnRoad (FVector Location, bool &Success) const
 Given a location, return the closest point on the centre of a lane. More...
 
TArray< FWaypointGetNext (FWaypoint Waypoint, float Distance=100.0f) const
 Return the list of waypoints at a given distance such that a vehicle at waypoint could drive to. More...
 
bool HasMap () const
 Return whether this map has been initialized. More...
 
bool Load (const FString &XODRContent)
 Load this map with an OpenDrive (XODR) file. More...
 
 UOpenDriveMap (const FObjectInitializer &ObjectInitializer)
 

Private Attributes

TOptional< carla::road::MapMap
 

Detailed Description

Helper class for exposing CARLA OpenDrive API to blueprints.

Definition at line 37 of file OpenDriveMap.h.

Constructor & Destructor Documentation

◆ UOpenDriveMap()

UOpenDriveMap::UOpenDriveMap ( const FObjectInitializer &  ObjectInitializer)

Definition at line 52 of file OpenDriveMap.cpp.

Member Function Documentation

◆ ComputeLocation()

FVector UOpenDriveMap::ComputeLocation ( FWaypoint  Waypoint) const

Compute the location of a waypoint.

Definition at line 102 of file OpenDriveMap.cpp.

References ComputeTransform().

Referenced by ComputeLocations().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ComputeLocations()

TArray< FVector > UOpenDriveMap::ComputeLocations ( const TArray< FWaypoint > &  Waypoints) const

Compute the locations of an array of waypoints.

Definition at line 107 of file OpenDriveMap.cpp.

References ComputeLocation().

+ Here is the call graph for this function:

◆ ComputeTransform()

FTransform UOpenDriveMap::ComputeTransform ( FWaypoint  Waypoint) const

Compute the transform of a waypoint.

The X-axis is directed towards the direction of the road at that waypoint.

Definition at line 115 of file OpenDriveMap.cpp.

References HasMap(), Map, and FWaypoint::Waypoint.

Referenced by ComputeLocation(), and ComputeTransforms().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ComputeTransforms()

TArray< FTransform > UOpenDriveMap::ComputeTransforms ( const TArray< FWaypoint > &  Waypoints) const

Compute the transforms of an array of waypoints.

Definition at line 122 of file OpenDriveMap.cpp.

References ComputeTransform().

+ Here is the call graph for this function:

◆ GenerateTopology()

TArray< FWaypointConnection > UOpenDriveMap::GenerateTopology ( ) const

Generate the minimum set of waypoints that define the topology of this map.

The waypoints are placed at the entrance of each lane.

Definition at line 86 of file OpenDriveMap.cpp.

References HasMap(), and Map.

+ Here is the call graph for this function:

◆ GenerateWaypoints()

TArray< FWaypoint > UOpenDriveMap::GenerateWaypoints ( float  ApproxDistance = 100.0f) const

Generate waypoints all over the map at an approximated distance.

Definition at line 74 of file OpenDriveMap.cpp.

References HasMap(), and Map.

+ Here is the call graph for this function:

◆ GenerateWaypointsOnRoadEntries()

TArray< FWaypoint > UOpenDriveMap::GenerateWaypointsOnRoadEntries ( ) const

Generate waypoints on each lane at the start of each road.

Definition at line 95 of file OpenDriveMap.cpp.

References HasMap(), and Map.

+ Here is the call graph for this function:

◆ GetClosestWaypointOnRoad()

FWaypoint UOpenDriveMap::GetClosestWaypointOnRoad ( FVector  Location,
bool &  Success 
) const

Given a location, return the closest point on the centre of a lane.

Definition at line 66 of file OpenDriveMap.cpp.

References HasMap(), and Map.

+ Here is the call graph for this function:

◆ GetNext()

TArray< FWaypoint > UOpenDriveMap::GetNext ( FWaypoint  Waypoint,
float  Distance = 100.0f 
) const

Return the list of waypoints at a given distance such that a vehicle at waypoint could drive to.

Definition at line 130 of file OpenDriveMap.cpp.

References HasMap(), Map, and FWaypoint::Waypoint.

+ Here is the call graph for this function:

◆ HasMap()

bool UOpenDriveMap::HasMap ( ) const
inline

Return whether this map has been initialized.

Definition at line 47 of file OpenDriveMap.h.

References carla::client::detail::Load(), and Success.

Referenced by ComputeTransform(), GenerateTopology(), GenerateWaypoints(), GenerateWaypointsOnRoadEntries(), GetClosestWaypointOnRoad(), GetNext(), and Load().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Load()

bool UOpenDriveMap::Load ( const FString &  XODRContent)

Load this map with an OpenDrive (XODR) file.

Definition at line 55 of file OpenDriveMap.cpp.

References HasMap(), carla::opendrive::OpenDriveParser::Load(), and Map.

Referenced by UOpenDrive::LoadOpenDriveMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ Map

TOptional<carla::road::Map> UOpenDriveMap::Map
private

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