CARLA
 
载入中...
搜索中...
未找到
SemanticLidarMeasurement.h
浏览该文件的文档.
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
14namespace carla {
15namespace sensor {
16namespace 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
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
Wrapper around the raw data generated by a sensor plus some useful meta-information.
Definition RawData.h:21
Base class for all the sensor data consisting of an array of items.
Definition Array.h:23
Helper class to store and serialize the data generated by a RawLidar.
auto GetHorizontalAngle() const
Horizontal angle of the Lidar at the time of the measurement.
auto GetChannelCount() const
Number of channels of the Lidar.
auto GetPointCount(size_t channel) const
Retrieve the number of points that channel generated.
Serializes the data generated by Lidar sensors.
static size_t GetHeaderOffset(const RawData &data)
static SemanticLidarHeaderView DeserializeHeader(const RawData &data)
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133