CARLA
 
载入中...
搜索中...
未找到
ActorState.cpp
浏览该文件的文档.
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
8
9#include <string>
10#include <iterator>
11
12namespace carla {
13namespace client {
14namespace detail {
15
17 rpc::Actor description,
18 EpisodeProxy episode)
19 : _description(std::move(description)),
20 _episode(std::move(episode)),
21 _display_id([](const auto &desc) {
22 using namespace std::string_literals;
23 return
24 "Actor "s +
25 std::to_string(desc.id) +
26 " (" + desc.description.id + ')';
27 }(_description)),
28 _attributes(_description.description.attributes.begin(), _description.description.attributes.end())
29 {}
30
31 SharedPtr<Actor> ActorState::GetParent() const {
32 auto parent_id = GetParentId();
33 return parent_id != 0u ? GetWorld().GetActor(parent_id) : nullptr;
34 }
35
36} // namespace detail
37} // namespace client
38} // namespace carla
ActorState(rpc::Actor description, EpisodeProxy episode)
EpisodeProxyImpl< EpisodeProxyPointerType::Strong > EpisodeProxy
_attributes(_description.description.attributes.begin(), _description.description.attributes.end())
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133
boost::shared_ptr< T > SharedPtr
Use this SharedPtr (boost::shared_ptr) to keep compatibility with boost::python, but it would be nice...
Definition Memory.h:20