CARLA
Loading...
Searching...
No Matches
Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/OpenDrive/OpenDrive.h
Go to the documentation of this file.
1// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7#pragma once
8
10
11#include <util/ue-header-guard-begin.h>
12#include "Kismet/BlueprintFunctionLibrary.h"
13#include <util/ue-header-guard-end.h>
14
15#include "OpenDrive.generated.h"
16
17UCLASS()
18class CARLA_API UOpenDrive : public UBlueprintFunctionLibrary
19{
20 GENERATED_BODY()
21
22public:
23
24 /// Return the OpenDrive XML associated to @a MapName, or empty if the file
25 /// is not found.
26 UFUNCTION(BlueprintCallable, Category="CARLA|OpenDrive")
27 static FString GetXODR(const UWorld *World);
28
29 /// Return the OpenDrive XML associated to @a MapName, or empty if the file
30 /// is not found.
31 UFUNCTION(BlueprintCallable, Category="CARLA|OpenDrive")
32 static FString GetXODRByPath(FString XODRPath, FString MapName);
33
34 UFUNCTION(BlueprintCallable, Category="CARLA|OpenDrive")
35 static FString FindPathToXODRFile(const FString &InMapName);
36
37 /// Where a generated OpenDRIVE world stores its xodr:
38 /// <ProjectSavedDir>/OpenDrive/<MapName>.xodr (read before any content dir),
39 /// or the folder SetSavedXODRDirectory set.
40 static FString GetSavedXODRPath(const FString &MapName);
41
42 /// Multi-GPU secondary: a folder of this process for the generated worlds
43 /// the primary sends, so that servers sharing an installation never read
44 /// each other's. Set once, before any map loads.
45 static void SetSavedXODRDirectory(const FString &Directory);
46
47 UFUNCTION(BlueprintCallable, Category="CARLA|OpenDrive")
48 static FString LoadXODR(const FString &MapName);
49
50 UFUNCTION(BlueprintCallable, Category="CARLA|OpenDrive")
51 static FString LoadXODRFullPath(const FString &FullPath);
52
53 /// Load OpenDriveMap associated to the given MapName. Return nullptr if no
54 /// XODR can be found with same MapName.
55 UFUNCTION(BlueprintCallable, Category="CARLA|OpenDrive")
56 static UOpenDriveMap *LoadOpenDriveMap(const FString &MapName);
57
58 /// Load OpenDriveMap associated to the currently loaded map. Return nullptr
59 /// if no XODR can be found that matches the current map.
60 UFUNCTION(BlueprintPure, Category="CARLA|OpenDrive", meta=(WorldContext="WorldContextObject"))
61 static UOpenDriveMap *LoadCurrentOpenDriveMap(const UObject *WorldContextObject);
62};
Helper class for exposing CARLA OpenDrive API to blueprints.