CARLA
Loading...
Searching...
No Matches
ContentPackManifest.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
9#include <util/ue-header-guard-begin.h>
10#include "CoreMinimal.h"
11#include <util/ue-header-guard-end.h>
12
13/// One map declared by a content pack manifest.
14struct CARLA_API FCarlaContentPackMap
15{
16 /// Map name as exposed by get_available_maps / load_world.
17 FString Name;
18
19 /// Long package name of the level, e.g. "/NewPack/Maps/NewTown".
20 FString Package;
21
22 /// OpenDRIVE file relative to the pack Content dir, e.g. "Maps/OpenDrive/NewTown.xodr".
23 FString Xodr;
24
25 bool bWorldPartition = false;
26};
27
28/// Parsed carla-pack.json. Authoritative for map discovery: nothing walks the
29/// pack directories looking for .umap files.
30///
31/// {
32/// "name": "NewPack", "version": "1.0.0",
33/// "carla_version": "0.10.2", "base_release": "carla-0.10.2-Linux",
34/// "engine": { "version": "5.8.0", "commit": "abcdef0" }, "platform": "Linux",
35/// "maps": [ { "name", "package", "xodr", "world_partition" } ],
36/// "catalogs": [ "Config/Vehicles.json", ... ],
37/// "files": { "<relpath>": "sha256:..." }
38/// }
40{
41 FString Name;
42 FString Version;
43 FString CarlaVersion;
44 FString BaseRelease;
46 FString EngineCommit;
47 FString Platform;
48 TArray<FCarlaContentPackMap> Maps;
49 TArray<FString> Catalogs;
50 TMap<FString, FString> Files;
51
52 /// Absolute path of the manifest file this was parsed from.
53 FString ManifestPath;
54
55 /// Absolute path of the pack directory (parent of the manifest).
56 FString PackDir;
57
58 /// Parse a manifest from a JSON string. OutError explains a false return.
59 static bool Parse(
60 const FString &JsonText,
61 FCarlaContentPackManifest &OutManifest,
62 FString &OutError);
63
64 /// Read and parse <ManifestPath>. Fills ManifestPath/PackDir.
65 static bool LoadFromFile(
66 const FString &InManifestPath,
67 FCarlaContentPackManifest &OutManifest,
68 FString &OutError);
69
70 /// Name must be usable as a plugin name and mount point ("/<Name>/").
71 static bool IsValidPackName(const FString &InName);
72
73 TArray<FString> GetMapNames() const;
74};
Parsed carla-pack.json.
FString ManifestPath
Absolute path of the manifest file this was parsed from.
FString PackDir
Absolute path of the pack directory (parent of the manifest).
TArray< FCarlaContentPackMap > Maps
TMap< FString, FString > Files
One map declared by a content pack manifest.
FString Package
Long package name of the level, e.g. "/NewPack/Maps/NewTown".
FString Xodr
OpenDRIVE file relative to the pack Content dir, e.g. "Maps/OpenDrive/NewTown.xodr".
FString Name
Map name as exposed by get_available_maps / load_world.