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  _simulation_state(state.GetSimulationState()) {
21  _actors.reserve(state.size());
22  for (auto &&actor : state) {
23  DEBUG_ONLY(auto result = )
24  _actors.emplace(
25  actor.id,
27  actor.id,
28  actor.transform,
29  actor.velocity,
30  actor.angular_velocity,
31  actor.acceleration,
32  actor.state});
33  DEBUG_ASSERT(result.second);
34  }
35  }
36 
37 } // namespace detail
38 } // namespace client
39 } // namespace carla
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:99
EpisodeState(uint64_t episode_id)
Definition: EpisodeState.h:34
#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:112