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

Public Member Functions

FVector ComputeLocation (FWaypoint Waypoint) const
 Compute the location of a waypoint.
 
TArray< FVector > ComputeLocations (const TArray< FWaypoint > &Waypoints) const
 Compute the locations of an array of waypoints.
 
FTransform ComputeTransform (FWaypoint Waypoint) const
 Compute the transform of a waypoint.
 
TArray< FTransform > ComputeTransforms (const TArray< FWaypoint > &Waypoints) const
 Compute the transforms of an array of waypoints.
 
TArray< FWaypointConnection > GenerateTopology () const
 Generate the minimum set of waypoints that define the topology of this map.
 
TArray< FWaypoint > GenerateWaypoints (float ApproxDistance=100.0f) const
 Generate waypoints all over the map at an approximated distance.
 
TArray< FWaypoint > GenerateWaypointsOnRoadEntries () const
 Generate waypoints on each lane at the start of each road.
 
FWaypoint GetClosestWaypointOnRoad (FVector Location, bool &Success) const
 Given a location, return the closest point on the centre of a lane.
 
TArray< FWaypoint > 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.
 
bool HasMap () const
 Return whether this map has been initialized.
 
bool Load (const FString &XODRContent)
 Load this map with an OpenDrive (XODR) file.
 
 UOpenDriveMap (const FObjectInitializer &ObjectInitializer)
 

Private Attributes

TOptional< carla::road::Map > Map
 

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 53 of file OpenDriveMap.cpp.

Member Function Documentation

◆ ComputeLocation()

FVector UOpenDriveMap::ComputeLocation ( FWaypoint  Waypoint) const

Compute the location of a waypoint.

Definition at line 103 of file OpenDriveMap.cpp.

References ComputeTransform().

Referenced by ComputeLocations().

◆ ComputeLocations()

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

Compute the locations of an array of waypoints.

Definition at line 108 of file OpenDriveMap.cpp.

References ComputeLocation().

◆ 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 116 of file OpenDriveMap.cpp.

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

Referenced by ComputeLocation(), and ComputeTransforms().

◆ ComputeTransforms()

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

Compute the transforms of an array of waypoints.

Definition at line 123 of file OpenDriveMap.cpp.

References ComputeTransform().

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

References HasMap(), and Map.

◆ GenerateWaypoints()

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

Generate waypoints all over the map at an approximated distance.

Definition at line 75 of file OpenDriveMap.cpp.

References HasMap(), and Map.

◆ GenerateWaypointsOnRoadEntries()

TArray< FWaypoint > UOpenDriveMap::GenerateWaypointsOnRoadEntries ( ) const

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

Definition at line 96 of file OpenDriveMap.cpp.

References HasMap(), and Map.

◆ 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 67 of file OpenDriveMap.cpp.

References HasMap(), Map, and Success.

◆ 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 131 of file OpenDriveMap.cpp.

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

◆ HasMap()

bool UOpenDriveMap::HasMap ( ) const
inline

Return whether this map has been initialized.

Definition at line 47 of file OpenDriveMap.h.

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

◆ Load()

bool UOpenDriveMap::Load ( const FString &  XODRContent)

Load this map with an OpenDrive (XODR) file.

Definition at line 56 of file OpenDriveMap.cpp.

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

Referenced by UOpenDrive::LoadOpenDriveMap().

Member Data Documentation

◆ Map

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

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