CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
sensor
data
SemanticLidarMeasurement.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/SemanticLidarSerializer.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"
);
22
using
Super
=
Array<data::SemanticLidarDetection>
;
23
24
protected
:
25
using
Serializer
=
s11n::SemanticLidarSerializer
;
26
27
friend
Serializer
;
28
29
explicit
SemanticLidarMeasurement
(
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
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
Array.h
Debug.h
SemanticLidarSerializer.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::SemanticLidarDetection >::Array
Array(RawData &&data, FuncT get_offset)
Definition
Array.h:127
carla::sensor::data::Array< data::SemanticLidarDetection >::GetRawData
const RawData & GetRawData() const
Definition
Array.h:139
carla::sensor::data::Array< data::SemanticLidarDetection >::data
value_type * data()
Definition
Array.h:94
carla::sensor::data::SemanticLidarDetection
Helper class to store and serialize the data generated by a RawLidar.
Definition
SemanticLidarData.h:56
carla::sensor::data::SemanticLidarMeasurement::GetHeader
auto GetHeader() const
Definition
SemanticLidarMeasurement.h:36
carla::sensor::data::SemanticLidarMeasurement::GetHorizontalAngle
auto GetHorizontalAngle() const
Horizontal angle of the Lidar at the time of the measurement.
Definition
SemanticLidarMeasurement.h:43
carla::sensor::data::SemanticLidarMeasurement::Super
Array< data::SemanticLidarDetection > Super
Definition
SemanticLidarMeasurement.h:22
carla::sensor::data::SemanticLidarMeasurement::SemanticLidarMeasurement
SemanticLidarMeasurement(RawData &&data)
Definition
SemanticLidarMeasurement.h:29
carla::sensor::data::SemanticLidarMeasurement::GetChannelCount
auto GetChannelCount() const
Number of channels of the Lidar.
Definition
SemanticLidarMeasurement.h:48
carla::sensor::data::SemanticLidarMeasurement::GetPointCount
auto GetPointCount(size_t channel) const
Retrieve the number of points that channel generated.
Definition
SemanticLidarMeasurement.h:55
carla::sensor::data::SemanticLidarMeasurement::Serializer
s11n::SemanticLidarSerializer Serializer
Definition
SemanticLidarMeasurement.h:25
carla::sensor::s11n::SemanticLidarSerializer
Serializes the data generated by Lidar sensors.
Definition
SemanticLidarSerializer.h:59
carla::sensor::s11n::SemanticLidarSerializer::GetHeaderOffset
static size_t GetHeaderOffset(const RawData &data)
Definition
SemanticLidarSerializer.h:66
carla::sensor::s11n::SemanticLidarSerializer::DeserializeHeader
static SemanticLidarHeaderView DeserializeHeader(const RawData &data)
Definition
SemanticLidarSerializer.h:62
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