CARLA
SemanticLidarMeasurement.h
Go to the documentation of this file.
1 // Copyright (c) 2020 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"
10 #include "carla/rpc/Location.h"
13 
14 namespace carla {
15 namespace sensor {
16 namespace data {
17 
18  /// Measurement produced by a Lidar. Consists of an array of 3D points plus
19  /// some extra meta-information about the Lidar.
20  class SemanticLidarMeasurement : public Array<data::SemanticLidarDetection> {
21  static_assert(sizeof(data::SemanticLidarDetection) == 6u * sizeof(float), "SemanticLidarDetection size missmatch");
23 
24  protected:
26 
27  friend Serializer;
28 
30  : Super(std::move(data), [](const RawData &d) {
32  }) {}
33 
34  private:
35 
36  auto GetHeader() const {
38  }
39 
40  public:
41 
42  /// Horizontal angle of the Lidar at the time of the measurement.
43  auto GetHorizontalAngle() const {
44  return GetHeader().GetHorizontalAngle();
45  }
46 
47  /// Number of channels of the Lidar.
48  auto GetChannelCount() const {
49  return GetHeader().GetChannelCount();
50  }
51 
52  /// Retrieve the number of points that @a channel generated. Points are
53  /// sorted by channel, so this method allows to identify the channel that
54  /// generated each point.
55  auto GetPointCount(size_t channel) const {
56  return GetHeader().GetPointCount(channel);
57  }
58  };
59 
60 } // namespace data
61 } // namespace sensor
62 } // namespace carla
auto GetChannelCount() const
Number of channels of the Lidar.
auto GetHorizontalAngle() const
Horizontal angle of the Lidar at the time of the measurement.
Helper class to store and serialize the data generated by a RawLidar.
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
Serializes the data generated by Lidar sensors.
auto GetPointCount(size_t channel) const
Retrieve the number of points that channel generated.
Base class for all the sensor data consisting of an array of items.
Definition: Array.h:23
static size_t GetHeaderOffset(const RawData &data)
static SemanticLidarHeaderView DeserializeHeader(const RawData &data)
Wrapper around the raw data generated by a sensor plus some useful meta-information.
Definition: RawData.h:21