CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
Unreal
CarlaUnreal
Plugins
Carla
Source
Carla
Sensor
WorldObserver.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 "
Carla/Sensor/DataStream.h
"
10
11
class
UCarlaEpisode
;
12
13
/// Serializes and sends all the actors in the current UCarlaEpisode.
14
class
FWorldObserver
15
{
16
public
:
17
18
/// Prevent this sensor to be spawned by users.
19
using
not_spawnable
= void;
20
21
/// Replace the Stream associated with this sensor.
22
void
SetStream
(
FDataMultiStream
InStream)
23
{
24
Stream
= std::move(InStream);
25
}
26
27
/// Return the token that allows subscribing to this sensor's stream.
28
auto
GetToken
()
const
29
{
30
return
Stream
.
GetToken
();
31
}
32
33
/// Send a message to every connected client with the info about the given @a
34
/// Episode.
35
void
BroadcastTick
(
36
const
UCarlaEpisode
&Episode,
37
float
DeltaSeconds,
38
bool
MapChange,
39
bool
PendingLightUpdate);
40
41
/// Dummy. Required for compatibility with other sensors only.
42
FTransform
GetActorTransform
()
const
43
{
44
return
{};
45
}
46
47
private
:
48
49
FDataMultiStream
Stream
;
50
};
DataStream.h
FDataMultiStream
FDataStreamTmpl< carla::streaming::Stream > FDataMultiStream
Definition
DataStream.h:82
FDataStreamTmpl::GetToken
auto GetToken() const
Return the token that allows subscribing to this stream.
Definition
DataStream.h:53
FWorldObserver
Serializes and sends all the actors in the current UCarlaEpisode.
Definition
WorldObserver.h:15
FWorldObserver::not_spawnable
void not_spawnable
Prevent this sensor to be spawned by users.
Definition
WorldObserver.h:19
FWorldObserver::GetToken
auto GetToken() const
Return the token that allows subscribing to this sensor's stream.
Definition
WorldObserver.h:28
FWorldObserver::GetActorTransform
FTransform GetActorTransform() const
Dummy. Required for compatibility with other sensors only.
Definition
WorldObserver.h:42
FWorldObserver::SetStream
void SetStream(FDataMultiStream InStream)
Replace the Stream associated with this sensor.
Definition
WorldObserver.h:22
FWorldObserver::BroadcastTick
void BroadcastTick(const UCarlaEpisode &Episode, float DeltaSeconds, bool MapChange, bool PendingLightUpdate)
Send a message to every connected client with the info about the given Episode.
Definition
WorldObserver.cpp:422
FWorldObserver::Stream
FDataMultiStream Stream
Definition
WorldObserver.h:49
UCarlaEpisode
A simulation episode.
Definition
CarlaEpisode.h:45
Generated by
1.18.0