CARLA
EpisodeState.cpp
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 
8 
9 namespace carla {
10 namespace client {
11 namespace detail {
12 
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,
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
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
EpisodeState(uint64_t episode_id)
Definition: EpisodeState.h:35
#define DEBUG_ASSERT(predicate)
Definition: Debug.h:66
State of the episode at a given frame.
#define DEBUG_ONLY(code)
Definition: Debug.h:55
size_type size() const
Definition: Array.h:89
std::unordered_map< ActorId, ActorSnapshot > _actors
Definition: EpisodeState.h:115