CARLA
rpc/Actor.h
Go to the documentation of this file.
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"
10 #include "carla/geom/BoundingBox.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 
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 
54  MSGPACK_DEFINE_ARRAY(id, parent_id, description, bounding_box, semantic_tags, stream_token);
55  };
56 
57 } // namespace rpc
58 } // namespace carla
streaming::Token GetStreamToken() const
Definition: rpc/Actor.h:45
MSGPACK_DEFINE_ARRAY(id, parent_id, description, bounding_box, semantic_tags, stream_token)
std::array< unsigned char, 24u > data
Definition: Token.h:20
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
ActorDescription description
Definition: rpc/Actor.h:29
#define DEBUG_ASSERT(predicate)
Definition: Debug.h:66
std::vector< unsigned char > stream_token
Definition: rpc/Actor.h:39
geom::BoundingBox bounding_box
Definition: rpc/Actor.h:31
A token that uniquely identify a stream.
Definition: Token.h:17
bool HasAStream() const
Definition: rpc/Actor.h:41
uint32_t ActorId
Definition: ActorId.h:14
std::vector< uint8_t > semantic_tags
Definition: rpc/Actor.h:33
ActorId parent_id
Definition: rpc/Actor.h:27