CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
sensor
data
LidarMeasurement.h
Go to the documentation of this file.
1
// Copyright (c) 2026 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
"
11
#include "
carla/sensor/data/Array.h
"
12
#include "
carla/sensor/s11n/LidarSerializer.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
LidarMeasurement
:
public
Array
<data::LidarDetection> {
21
static_assert
(
sizeof
(
data::LidarDetection
) == 4u *
sizeof
(float),
"Location size missmatch"
);
22
using
Super
=
Array<data::LidarDetection>
;
23
24
protected
:
25
using
Serializer
=
s11n::LidarSerializer
;
26
27
friend
Serializer
;
28
29
explicit
LidarMeasurement
(
RawData
&&
data
)
30
:
Super
(
std
::move(
data
), [](const
RawData
&d) {
31
return
Serializer::GetHeaderOffset
(d);
32
}) {}
33
34
private
:
35
36
auto
GetHeader
()
const
{
37
return
Serializer::DeserializeHeader
(
Super::GetRawData
());
38
}
39
40
public
:
41
/// Horizontal angle of the Lidar at the time of the measurement.
42
auto
GetHorizontalAngle
()
const
{
43
return
GetHeader
().GetHorizontalAngle();
44
}
45
46
/// Number of channels of the Lidar.
47
auto
GetChannelCount
()
const
{
48
return
GetHeader
().GetChannelCount();
49
}
50
51
/// Retrieve the number of points that @a channel generated. Points are
52
/// sorted by channel, so this method allows to identify the channel that
53
/// generated each point.
54
auto
GetPointCount
(
size_t
channel)
const
{
55
return
GetHeader
().GetPointCount(channel);
56
}
57
};
58
59
}
// namespace data
60
}
// namespace sensor
61
}
// namespace carla
Array.h
Debug.h
LidarSerializer.h
carla::sensor::RawData
Wrapper around the raw data generated by a sensor plus some useful meta-information.
Definition
RawData.h:21
carla::sensor::data::Array< data::LidarDetection >::Array
Array(RawData &&data, FuncT get_offset)
Definition
Array.h:127
carla::sensor::data::Array< data::LidarDetection >::GetRawData
const RawData & GetRawData() const
Definition
Array.h:139
carla::sensor::data::Array< data::LidarDetection >::data
value_type * data()
Definition
Array.h:94
carla::sensor::data::LidarDetection
Helper class to store and serialize the data generated by a Lidar.
Definition
LidarData.h:54
carla::sensor::data::LidarMeasurement::GetPointCount
auto GetPointCount(size_t channel) const
Retrieve the number of points that channel generated.
Definition
LidarMeasurement.h:54
carla::sensor::data::LidarMeasurement::GetHorizontalAngle
auto GetHorizontalAngle() const
Horizontal angle of the Lidar at the time of the measurement.
Definition
LidarMeasurement.h:42
carla::sensor::data::LidarMeasurement::GetChannelCount
auto GetChannelCount() const
Number of channels of the Lidar.
Definition
LidarMeasurement.h:47
carla::sensor::data::LidarMeasurement::Super
Array< data::LidarDetection > Super
Definition
LidarMeasurement.h:22
carla::sensor::data::LidarMeasurement::Serializer
s11n::LidarSerializer Serializer
Definition
LidarMeasurement.h:25
carla::sensor::data::LidarMeasurement::LidarMeasurement
LidarMeasurement(RawData &&data)
Definition
LidarMeasurement.h:29
carla::sensor::data::LidarMeasurement::GetHeader
auto GetHeader() const
Definition
LidarMeasurement.h:36
carla::sensor::s11n::LidarSerializer
Serializes the data generated by Lidar sensors.
Definition
LidarSerializer.h:58
carla::sensor::s11n::LidarSerializer::DeserializeHeader
static LidarHeaderView DeserializeHeader(const RawData &data)
Definition
LidarSerializer.h:61
carla::sensor::s11n::LidarSerializer::GetHeaderOffset
static size_t GetHeaderOffset(const RawData &data)
Definition
LidarSerializer.h:65
carla::sensor::data
Definition
ROS2.h:33
carla::sensor
Definition
client/detail/Client.h:58
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
std
Definition
CarlaRecorderCollision.h:31
Location.h
Generated by
1.18.0