CARLA
RawEpisodeState.h
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 
7 #pragma once
8 
9 #include "carla/Debug.h"
13 
14 namespace carla {
15 namespace sensor {
16 namespace data {
17 
18  /// State of the episode at a given frame.
19  class RawEpisodeState : public Array<ActorDynamicState> {
21  protected:
22 
24 
25  friend Serializer;
26 
28  : Super(Serializer::header_offset, std::move(data)) {}
29 
30  private:
31 
32  auto GetHeader() const {
34  }
35 
36  public:
37 
38  /// Unique id of the episode at which this data was generated.
39  uint64_t GetEpisodeId() const {
40  return GetHeader().episode_id;
41  }
42 
43  /// Simulation time-stamp, simulated seconds elapsed since the beginning of
44  /// the current episode.
45  double GetGameTimeStamp() const {
46  return GetTimestamp();
47  }
48 
49  /// Time-stamp of the frame at which this measurement was taken, in seconds
50  /// as given by the OS.
51  double GetPlatformTimeStamp() const {
52  return GetHeader().platform_timestamp;
53  }
54 
55  /// Simulated seconds elapsed since previous frame.
56  double GetDeltaSeconds() const {
57  return GetHeader().delta_seconds;
58  }
59 
61  return GetHeader().map_origin;
62  }
63 
64  /// Simulation state flags
66  return GetHeader().simulation_state;
67  }
68 
69  };
70 
71 } // namespace data
72 } // namespace sensor
73 } // namespace carla
Serializer::SimulationState GetSimulationState() const
Simulation state flags.
Serializes the current state of the whole episode.
uint64_t GetEpisodeId() const
Unique id of the episode at which this data was generated.
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
double GetGameTimeStamp() const
Simulation time-stamp, simulated seconds elapsed since the beginning of the current episode...
double GetTimestamp() const
Simulation-time when the data was generated.
Definition: SensorData.h:43
static const Header & DeserializeHeader(const RawData &message)
Base class for all the sensor data consisting of an array of items.
Definition: Array.h:23
geom::Vector3DInt GetMapOrigin() const
State of the episode at a given frame.
double GetDeltaSeconds() const
Simulated seconds elapsed since previous frame.
Wrapper around the raw data generated by a sensor plus some useful meta-information.
Definition: RawData.h:21
double GetPlatformTimeStamp() const
Time-stamp of the frame at which this measurement was taken, in seconds as given by the OS...