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