CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
sensor
s11n
CollisionEventSerializer.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/Buffer.h
"
10
#include "
carla/Debug.h
"
11
#include "
carla/Memory.h
"
12
#include "
carla/rpc/Actor.h
"
13
#include "
carla/geom/Vector3D.h
"
14
#include "
carla/sensor/RawData.h
"
15
16
namespace
carla
{
17
namespace
sensor
{
18
19
class
SensorData
;
20
21
namespace
s11n
{
22
23
/// Serializes the current state of the whole episode.
24
class
CollisionEventSerializer
{
25
public
:
26
27
struct
Data
{
28
29
rpc::Actor
self_actor
;
30
31
rpc::Actor
other_actor
;
32
33
geom::Vector3D
normal_impulse
;
34
35
MSGPACK_DEFINE_ARRAY(
self_actor
,
other_actor
,
normal_impulse
)
36
};
37
38
constexpr
static
auto
header_offset
= 0u;
39
40
static
Data
DeserializeRawData
(
const
RawData
&message) {
41
return
MsgPack::UnPack<Data>
(message.
begin
(), message.
size
());
42
}
43
44
template
<
typename
SensorT>
45
static
Buffer
Serialize
(
46
const
SensorT &,
47
rpc::Actor
self_actor,
48
rpc::Actor
other_actor,
49
geom::Vector3D
normal_impulse) {
50
return
MsgPack::Pack
(
Data
{self_actor, other_actor, normal_impulse});
51
}
52
53
static
SharedPtr<SensorData>
Deserialize
(
RawData
&&
data
);
54
};
55
56
}
// namespace s11n
57
}
// namespace sensor
58
}
// namespace carla
Debug.h
Memory.h
RawData.h
Buffer.h
carla::Buffer
A piece of raw data.
Definition
carla/Buffer.h:42
carla::MsgPack::UnPack
static T UnPack(const Buffer &buffer)
Definition
MsgPack.h:27
carla::MsgPack::Pack
static Buffer Pack(const T &obj)
Definition
MsgPack.h:19
carla::rpc::Actor
Definition
rpc/Actor.h:20
carla::sensor::RawData
Wrapper around the raw data generated by a sensor plus some useful meta-information.
Definition
RawData.h:21
carla::sensor::RawData::begin
auto begin() noexcept
Begin iterator to the data generated by the sensor.
Definition
RawData.h:52
carla::sensor::RawData::size
size_t size() const
Size in bytes of the data generated by the sensor.
Definition
RawData.h:83
carla::sensor::SensorData
Base class for all the objects containing data generated by a sensor.
Definition
SensorData.h:22
carla::sensor::s11n::CollisionEventSerializer
Serializes the current state of the whole episode.
Definition
CollisionEventSerializer.h:24
carla::sensor::s11n::CollisionEventSerializer::Serialize
static Buffer Serialize(const SensorT &, rpc::Actor self_actor, rpc::Actor other_actor, geom::Vector3D normal_impulse)
Definition
CollisionEventSerializer.h:45
carla::sensor::s11n::CollisionEventSerializer::DeserializeRawData
static Data DeserializeRawData(const RawData &message)
Definition
CollisionEventSerializer.h:40
carla::sensor::s11n::CollisionEventSerializer::Deserialize
static SharedPtr< SensorData > Deserialize(RawData &&data)
Definition
CollisionEventSerializer.cpp:14
carla::sensor::s11n::CollisionEventSerializer::header_offset
static constexpr auto header_offset
Definition
CollisionEventSerializer.h:38
Vector3D.h
carla::sensor::data
Definition
ROS2.h:33
carla::sensor::s11n
Definition
ROS2.h:39
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
carla::SharedPtr
std::shared_ptr< T > SharedPtr
Definition
Memory.h:15
Actor.h
carla::geom::Vector3D
Definition
geom/Vector3D.h:17
carla::sensor::s11n::CollisionEventSerializer::Data
Definition
CollisionEventSerializer.h:27
carla::sensor::s11n::CollisionEventSerializer::Data::normal_impulse
geom::Vector3D normal_impulse
Definition
CollisionEventSerializer.h:33
carla::sensor::s11n::CollisionEventSerializer::Data::other_actor
rpc::Actor other_actor
Definition
CollisionEventSerializer.h:31
carla::sensor::s11n::CollisionEventSerializer::Data::self_actor
rpc::Actor self_actor
Definition
CollisionEventSerializer.h:29
Generated by
1.18.0