CARLA
LibCarla/source/carla/rpc/ActorDefinition.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/MsgPack.h"
11 #include "carla/rpc/ActorId.h"
12 #include "carla/rpc/String.h"
13 
14 #include <vector>
15 
16 namespace carla {
17 namespace rpc {
18 
20  public:
21 
22  ActorDefinition() = default;
23 
24  ActorId uid = 0u;
25 
26  std::string id;
27 
28  std::string tags;
29 
30  std::vector<ActorAttribute> attributes;
31 
32 #ifdef LIBCARLA_INCLUDED_FROM_UE4
33 
34  ActorDefinition(const FActorDefinition &Definition)
35  : uid(Definition.UId),
36  id(FromFString(Definition.Id)),
37  tags(FromFString(Definition.Tags)) {
38  attributes.reserve(Definition.Variations.Num() + Definition.Attributes.Num());
39  for (const auto &Item : Definition.Variations) {
40  attributes.push_back(Item);
41  }
42  for (const auto &Item : Definition.Attributes) {
43  attributes.push_back(Item);
44  }
45  }
46 
47 #endif // LIBCARLA_INCLUDED_FROM_UE4
48 
49  MSGPACK_DEFINE_ARRAY(uid, id, tags, attributes);
50  };
51 
52 } // namespace rpc
53 } // namespace carla
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
A definition of a Carla Actor with all the variation and attributes.
MSGPACK_DEFINE_ARRAY(uid, id, tags, attributes)
TArray< FActorVariation > Variations
Variations represent variables the user can modify to generate variations of the actor.
uint32_t ActorId
Definition: ActorId.h:14
TArray< FActorAttribute > Attributes
Attributes represent non-modifiable properties of the actor that might help the user identifying and ...