CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
client
detail
ActorState.cpp
Go to the documentation of this file.
1
// Copyright (c) 2026 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
#include "
carla/client/detail/ActorState.h
"
8
9
#include <string>
10
#include <iterator>
11
12
namespace
carla
{
13
namespace
client
{
14
namespace
detail
{
15
16
ActorState::ActorState
(
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
carla::client::detail::ActorState::GetParent
SharedPtr< Actor > GetParent() const
Definition
ActorState.cpp:31
carla::client::detail::ActorState::ActorState
ActorState(rpc::Actor description, EpisodeProxy episode)
carla::client::detail::ActorState::GetParentId
ActorId GetParentId() const
Definition
client/detail/ActorState.h:39
carla::client::detail::ActorState::GetWorld
World GetWorld() const
Definition
client/detail/ActorState.h:49
ActorState.h
carla::client::detail
Definition
AtomicList.h:18
carla::client::detail::EpisodeProxy
EpisodeProxyImpl< EpisodeProxyPointerType::Strong > EpisodeProxy
Definition
EpisodeProxy.h:69
carla::client::detail::_attributes
_attributes(_description.description.attributes.begin(), _description.description.attributes.end())
Definition
ActorState.cpp:28
carla::client
Definition
BasicAgent.h:24
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
carla::SharedPtr
std::shared_ptr< T > SharedPtr
Definition
Memory.h:15
Generated by
1.18.0