CARLA
IMUMeasurement.h
Go to the documentation of this file.
1 // Copyright (c) 2019 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/geom/Vector3D.h"
12 
13 namespace carla {
14 namespace sensor {
15 namespace data {
16 
17  class IMUMeasurement : public SensorData {
18  protected:
19 
20  using Super = SensorData;
21 
23 
24  friend Serializer;
25 
26  explicit IMUMeasurement(const RawData &data)
27  : Super(data),
28  _accelerometer(Serializer::DeserializeRawData(data).accelerometer),
29  _gyroscope(Serializer::DeserializeRawData(data).gyroscope),
30  _compass(Serializer::DeserializeRawData(data).compass) {}
31 
32  public:
33 
35  return _accelerometer;
36  }
37 
39  return _gyroscope;
40  }
41 
42  float GetCompass() const {
43  return _compass;
44  }
45 
46  private:
47 
50  float _compass;
51 
52  };
53 
54 } // namespace data
55 } // namespace sensor
56 } // namespace carla
geom::Vector3D GetGyroscope() const
IMUMeasurement(const RawData &data)
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
SensorData(size_t frame, double timestamp, const rpc::Transform &sensor_transform)
Definition: SensorData.h:25
Base class for all the objects containing data generated by a sensor.
Definition: SensorData.h:20
geom::Vector3D GetAccelerometer() const
Wrapper around the raw data generated by a sensor plus some useful meta-information.
Definition: RawData.h:21