CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
Unreal
CarlaUnreal
Plugins
Carla
Source
Carla
Navigation
CarlaNavigationSubsystem.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 "Subsystems/WorldSubsystem.h"
12
#include <util/ue-header-guard-end.h>
13
14
#include "CarlaNavigationSubsystem.generated.h"
15
16
/// Thin wrapper over the engine navigation system (UNavigationSystemV1) used
17
/// by the server-side pedestrian navigation RPCs. On World Partition maps the
18
/// navmesh streams with the cells, so every query below operates on the
19
/// currently loaded tiles only.
20
UCLASS()
21
class CARLA_API
UCarlaNavigationSubsystem
: public
UWorldSubsystem
22
{
23
GENERATED_BODY()
24
25
public
:
26
27
static
UCarlaNavigationSubsystem
*
Get
(UWorld *World)
28
{
29
return
World !=
nullptr
30
? World->GetSubsystem<
UCarlaNavigationSubsystem
>()
31
:
nullptr
;
32
}
33
34
/// True iff the current world has a RecastNavMesh with valid nav data:
35
/// the signal for clients that walker navigation runs server-side here.
36
bool
HasServerSideNavigation()
const
;
37
38
/// Random point on the loaded navmesh where a walker can stand, in
39
/// world-local centimeters. Points whose surroundings are still streaming
40
/// in, or where a walker capsule would overlap static geometry (the terrain
41
/// under a building footprint, issue #10212), are resampled; returns false
42
/// when no acceptable point is found.
43
bool
GetRandomNavLocation(FVector &OutLocation)
const
;
44
45
private
:
46
47
/// Why a sampled nav point was rejected, for the Verbose log.
48
enum class
ERejectReason
: uint8
49
{
50
None,
51
NotStreamed,
52
Overlap
53
};
54
55
/// Checks a sampled nav point: on World Partition maps the cells around it
56
/// must be activated (so a building above it is already there), and a
57
/// walker-sized capsule standing on it must not overlap static geometry.
58
ERejectReason CheckWalkerLocation(
59
const
FVector &
Location
,
60
const
class
ANavigationData &NavData)
const
;
61
};
UCarlaNavigationSubsystem
Thin wrapper over the engine navigation system (UNavigationSystemV1) used by the server-side pedestri...
Definition
CarlaNavigationSubsystem.h:22
UCarlaNavigationSubsystem::Get
static UCarlaNavigationSubsystem * Get(UWorld *World)
Definition
CarlaNavigationSubsystem.h:27
UCarlaNavigationSubsystem::ERejectReason
ERejectReason
Why a sampled nav point was rejected, for the Verbose log.
Definition
CarlaNavigationSubsystem.h:49
UWorldSubsystem
Location
Definition
geom/Location.h:23
Generated by
1.18.0