CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
client
detail
EpisodeState.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/EpisodeState.h
"
8
9
namespace
carla
{
10
namespace
client
{
11
namespace
detail
{
12
13
EpisodeState::EpisodeState
(
const
sensor::data::RawEpisodeState
&state)
14
:
_episode_id
(state.
GetEpisodeId
()),
15
_timestamp
(
16
state.
GetFrame
(),
17
state.GetGameTimeStamp(),
18
state.GetDeltaSeconds(),
19
state.GetPlatformTimeStamp()),
20
_map_origin
(state.GetMapOrigin()),
21
_simulation_state
(state.GetSimulationState()) {
22
_actors
.reserve(state.
size
());
23
for (
auto
&&actor : state) {
24
DEBUG_ONLY
(
auto
result = )
25
_actors
.emplace(
26
actor.id,
27
ActorSnapshot
{
28
actor.id,
29
actor.actor_state,
30
actor.transform,
31
actor.velocity,
32
actor.angular_velocity,
33
actor.acceleration,
34
actor.state});
35
DEBUG_ASSERT
(result.second);
36
}
37
}
38
39
}
// namespace detail
40
}
// namespace client
41
}
// namespace carla
DEBUG_ASSERT
#define DEBUG_ASSERT(predicate)
Definition
Debug.h:66
DEBUG_ONLY
#define DEBUG_ONLY(code)
Definition
Debug.h:55
EpisodeState.h
carla::client::detail::EpisodeState::EpisodeState
EpisodeState(uint64_t episode_id)
Definition
EpisodeState.h:35
carla::client::detail::EpisodeState::_episode_id
const uint64_t _episode_id
Definition
EpisodeState.h:107
carla::client::detail::EpisodeState::_map_origin
geom::Vector3DInt _map_origin
Definition
EpisodeState.h:111
carla::client::detail::EpisodeState::_simulation_state
SimulationState _simulation_state
Definition
EpisodeState.h:113
carla::client::detail::EpisodeState::GetEpisodeId
auto GetEpisodeId() const
Definition
EpisodeState.h:39
carla::client::detail::EpisodeState::_actors
std::unordered_map< ActorId, ActorSnapshot > _actors
Definition
EpisodeState.h:115
carla::client::detail::EpisodeState::_timestamp
const Timestamp _timestamp
Definition
EpisodeState.h:109
carla::client::detail::EpisodeState::GetFrame
auto GetFrame() const
Definition
EpisodeState.h:43
carla::sensor::data::Array::size
size_type size() const
Definition
Array.h:89
carla::sensor::data::RawEpisodeState
State of the episode at a given frame.
Definition
RawEpisodeState.h:19
carla::client::detail
Definition
AtomicList.h:18
carla::client
Definition
BasicAgent.h:24
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
carla::client::ActorSnapshot
Definition
ActorSnapshot.h:18
Generated by
1.18.0