CARLA
 
载入中...
搜索中...
未找到
LibCarla/source/carla/rpc/ActorDescription.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/MsgPack.h"
11#include "carla/rpc/ActorId.h"
12#include "carla/rpc/String.h"
13
14#include <vector>
15
16#ifdef LIBCARLA_INCLUDED_FROM_UE4
20#endif // LIBCARLA_INCLUDED_FROM_UE4
21
22namespace carla {
23namespace rpc {
24
26 public:
27
28 ActorDescription() = default;
29
31
32 std::string id;
33
34 std::vector<ActorAttributeValue> attributes;
35
36#ifdef LIBCARLA_INCLUDED_FROM_UE4
37
39 : uid(Description.UId),
40 id(FromFString(Description.Id)) {
41 attributes.reserve(Description.Variations.Num());
42 for (const auto &Item : Description.Variations) {
43 attributes.emplace_back(Item.Value);
44 }
45 }
46
47 operator FActorDescription() const {
48 FActorDescription Description;
49 Description.UId = uid;
50 Description.Id = ToFString(id);
51 Description.Variations.Reserve(attributes.size());
52 for (const auto &item : attributes) {
53 Description.Variations.Emplace(ToFString(item.id), item);
54 }
55 return Description;
56 }
57
58#endif // LIBCARLA_INCLUDED_FROM_UE4
59
61 };
62
63} // namespace rpc
64} // namespace carla
ActorDescription(const FActorDescription &Description)
MSGPACK_DEFINE_ARRAY(uid, id, attributes)
uint32_t ActorId
Definition ActorId.h:14
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133
A description of a Carla Actor with all its variation.
TMap< FString, FActorAttribute > Variations
User selected variations of the actor.
uint32 UId
UId of the definition in which this description was based.