CARLA
 
载入中...
搜索中...
未找到
SensorData.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/Memory.h"
10#include "carla/NonCopyable.h"
12
13/// @todo This shouldn't be exposed in this namespace.
15
16namespace carla {
17namespace sensor {
18
19 /// Base class for all the objects containing data generated by a sensor.
21 : public EnableSharedFromThis<SensorData>,
22 private NonCopyable {
23 protected:
24
25 SensorData(size_t frame, double timestamp, const rpc::Transform &sensor_transform)
26 : _frame(frame),
27 _timestamp(timestamp),
28 _sensor_transform(sensor_transform) {}
29
30 explicit SensorData(const RawData &data)
31 : SensorData(data.GetFrame(), data.GetTimestamp(), data.GetSensorTransform()) {}
32
33 public:
34
35 virtual ~SensorData() = default;
36
37 /// Frame count when the data was generated.
38 size_t GetFrame() const {
39 return _frame;
40 }
41
42 /// Simulation-time when the data was generated.
43 double GetTimestamp() const {
44 return _timestamp;
45 }
46
47 /// Sensor's transform when the data was generated.
49 return _sensor_transform;
50 }
51
52 protected:
53
54 const auto &GetEpisode() const {
55 return _episode;
56 }
57
58 private:
59
60 /// @todo This shouldn't be exposed in this namespace.
63
64 const size_t _frame;
65
66 const double _timestamp;
67
69 };
70
71} // namespace sensor
72} // namespace carla
Inherit (privately) to suppress copy/move construction and assignment.
Connects and controls a CARLA Simulator.
Definition Simulator.h:52
Wrapper around the raw data generated by a sensor plus some useful meta-information.
Definition RawData.h:21
Base class for all the objects containing data generated by a sensor.
Definition SensorData.h:22
double GetTimestamp() const
Simulation-time when the data was generated.
Definition SensorData.h:43
size_t GetFrame() const
Frame count when the data was generated.
Definition SensorData.h:38
virtual ~SensorData()=default
client::detail::WeakEpisodeProxy _episode
Definition SensorData.h:62
const rpc::Transform _sensor_transform
Definition SensorData.h:68
const auto & GetEpisode() const
Definition SensorData.h:54
SensorData(size_t frame, double timestamp, const rpc::Transform &sensor_transform)
Definition SensorData.h:25
SensorData(const RawData &data)
Definition SensorData.h:30
const rpc::Transform & GetSensorTransform() const
Sensor's transform when the data was generated.
Definition SensorData.h:48
EpisodeProxyImpl< EpisodeProxyPointerType::Weak > WeakEpisodeProxy
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133