CARLA
 
载入中...
搜索中...
未找到
RawEpisodeState.h
浏览该文件的文档.
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
14namespace carla {
15namespace sensor {
16namespace 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
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
Wrapper around the raw data generated by a sensor plus some useful meta-information.
Definition RawData.h:21
double GetTimestamp() const
Simulation-time when the data was generated.
Definition SensorData.h:43
Base class for all the sensor data consisting of an array of items.
Definition Array.h:23
State of the episode at a given frame.
Serializer::SimulationState GetSimulationState() const
Simulation state flags
double GetGameTimeStamp() const
Simulation time-stamp, simulated seconds elapsed since the beginning of the current episode.
double GetPlatformTimeStamp() const
Time-stamp of the frame at which this measurement was taken, in seconds as given by the OS.
geom::Vector3DInt GetMapOrigin() const
uint64_t GetEpisodeId() const
Unique id of the episode at which this data was generated.
double GetDeltaSeconds() const
Simulated seconds elapsed since previous frame.
Serializes the current state of the whole episode.
static const Header & DeserializeHeader(const RawData &message)
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133