CARLA
 
载入中...
搜索中...
未找到
rpc/Actor.h
浏览该文件的文档.
1// Copyright (c) 2017 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"
12#include "carla/rpc/ActorId.h"
14
15#include <cstring>
16
17namespace carla {
18namespace rpc {
19
20 class Actor {
21 public:
22
23 Actor() = default;
24
25 ActorId id = 0u;
26
28
30
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
47 streaming::Token token;
48 std::memcpy(&token.data[0u], stream_token.data(), stream_token.size());
49 return token;
50 }
51
52 /// @}
53
55 };
56
57} // namespace rpc
58} // namespace carla
#define DEBUG_ASSERT(predicate)
Definition Debug.h:66
std::vector< unsigned char > stream_token
Definition rpc/Actor.h:39
streaming::Token GetStreamToken() const
Definition rpc/Actor.h:45
std::vector< uint8_t > semantic_tags
Definition rpc/Actor.h:33
bool HasAStream() const
Definition rpc/Actor.h:41
MSGPACK_DEFINE_ARRAY(id, parent_id, description, bounding_box, semantic_tags, stream_token)
ActorId parent_id
Definition rpc/Actor.h:27
ActorDescription description
Definition rpc/Actor.h:29
geom::BoundingBox bounding_box
Definition rpc/Actor.h:31
A token that uniquely identify a stream.
Definition Token.h:17
std::array< unsigned char, 24u > data
Definition Token.h:20
uint32_t ActorId
Definition ActorId.h:14
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133