CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
rpc
rpc/Actor.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/Debug.h
"
10
#include "
carla/geom/BoundingBox.h
"
11
#include "
carla/rpc/ActorDescription.h
"
12
#include "
carla/rpc/ActorId.h
"
13
#include "
carla/streaming/Token.h
"
14
15
#include <cstring>
16
17
namespace
carla
{
18
namespace
rpc
{
19
20
class
Actor
{
21
public
:
22
23
Actor
() =
default
;
24
25
ActorId
id
= 0u;
26
27
ActorId
parent_id
= 0u;
28
29
ActorDescription
description
;
30
31
geom::BoundingBox
bounding_box
;
32
33
std::vector<uint8_t>
semantic_tags
;
34
35
/// @todo This is only used by sensors actually.
36
/// @name Sensor functionality
37
/// @{
38
39
std::vector<unsigned char>
stream_token
;
40
41
bool
HasAStream
()
const
{
42
return
stream_token
.size() ==
sizeof
(
streaming::Token::data
);
43
}
44
45
streaming::Token
GetStreamToken
()
const
{
46
DEBUG_ASSERT
(
HasAStream
());
47
streaming::Token
token;
48
std::memcpy(&token.
data
[0u],
stream_token
.data(),
stream_token
.size());
49
return
token;
50
}
51
52
/// @}
53
54
/// Server frame counter when a spawn call created this actor: snapshots up
55
/// to and including this frame predate it. 0 when the actor did not come
56
/// from a spawn call, or from a server that does not report it. Last in the
57
/// array so that either side reads the other's older layout.
58
uint64_t
spawn_frame
= 0u;
59
60
MSGPACK_DEFINE_ARRAY
(
id
,
parent_id
,
description
,
bounding_box
,
semantic_tags
,
stream_token
,
spawn_frame
);
61
};
62
63
}
// namespace rpc
64
}
// namespace carla
ActorId.h
Debug.h
DEBUG_ASSERT
#define DEBUG_ASSERT(predicate)
Definition
Debug.h:66
BoundingBox.h
ActorDescription.h
Token.h
carla::geom::BoundingBox
Definition
LibCarla/source/carla/geom/BoundingBox.h:26
carla::rpc::ActorDescription
Definition
LibCarla/source/carla/rpc/ActorDescription.h:25
carla::rpc::Actor::stream_token
std::vector< unsigned char > stream_token
Definition
rpc/Actor.h:39
carla::rpc::Actor::GetStreamToken
streaming::Token GetStreamToken() const
Definition
rpc/Actor.h:45
carla::rpc::Actor::semantic_tags
std::vector< uint8_t > semantic_tags
Definition
rpc/Actor.h:33
carla::rpc::Actor::HasAStream
bool HasAStream() const
Definition
rpc/Actor.h:41
carla::rpc::Actor::spawn_frame
uint64_t spawn_frame
Server frame counter when a spawn call created this actor: snapshots up to and including this frame p...
Definition
rpc/Actor.h:58
carla::rpc::Actor::parent_id
ActorId parent_id
Definition
rpc/Actor.h:27
carla::rpc::Actor::Actor
Actor()=default
carla::rpc::Actor::description
ActorDescription description
Definition
rpc/Actor.h:29
carla::rpc::Actor::bounding_box
geom::BoundingBox bounding_box
Definition
rpc/Actor.h:31
carla::rpc::Actor::MSGPACK_DEFINE_ARRAY
MSGPACK_DEFINE_ARRAY(id, parent_id, description, bounding_box, semantic_tags, stream_token, spawn_frame)
carla::streaming::Token
A token that uniquely identify a stream.
Definition
Token.h:17
carla::streaming::Token::data
std::array< unsigned char, 24u > data
Definition
Token.h:20
carla::rpc
Definition
DebugShapeDrawer.h:11
carla::rpc::ActorId
uint32_t ActorId
Definition
ActorId.h:14
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
Generated by
1.18.0