CARLA
Loading...
Searching...
No Matches
LibCarla
source
carla
ros2
middleware
QosProfile.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 <cstdint>
10
11
namespace
carla
{
12
namespace
ros2 {
13
14
/// Middleware-neutral QoS profile passed to IPublisherMiddleware::Init /
15
/// ISubscriberMiddleware::Init when a topic needs QoS different from the
16
/// vendor defaults (e.g. the Autoware command subscribers require
17
/// RELIABLE + TRANSIENT_LOCAL to latch the last command).
18
///
19
/// This replaces tier4's TopicConfig (data_types.h) in the
20
/// middleware-decoupled architecture: the domain id is NOT part of the
21
/// profile (it lives in MiddlewareConfig.h) and the topic suffix is the
22
/// caller's concern (publishers append suffixes to their base topic name).
23
///
24
/// The defaults (RELIABLE / VOLATILE / KEEP_LAST depth 1) mirror the FastDDS
25
/// DataWriter defaults so passing QosProfile{} to a publisher is equivalent
26
/// to the QoS-less Init overload.
27
struct
QosProfile
{
28
enum class
Reliability
: std::uint8_t {
Reliable
,
BestEffort
};
29
enum class
Durability
: std::uint8_t {
Volatile
,
TransientLocal
};
30
enum class
History
: std::uint8_t {
KeepLast
,
KeepAll
};
31
32
Reliability
reliability
{
Reliability::Reliable
};
33
Durability
durability
{
Durability::Volatile
};
34
History
history
{
History::KeepLast
};
35
std::int32_t
history_depth
{1};
36
37
/// RELIABLE / TRANSIENT_LOCAL / KEEP_LAST depth 1 — the profile tier4 uses
38
/// for the Autoware command subscribers (latched commands survive a late
39
/// subscriber join).
40
static
QosProfile
ReliableTransientLocal
() {
41
QosProfile
p;
42
p.
reliability
=
Reliability::Reliable
;
43
p.
durability
=
Durability::TransientLocal
;
44
p.
history
=
History::KeepLast
;
45
p.
history_depth
= 1;
46
return
p;
47
}
48
49
/// RELIABLE / VOLATILE / KEEP_LAST depth 1 — the profile tier4 uses for the
50
/// Autoware report publishers.
51
static
QosProfile
ReliableVolatile
() {
52
QosProfile
p;
53
p.
reliability
=
Reliability::Reliable
;
54
p.
durability
=
Durability::Volatile
;
55
p.
history
=
History::KeepLast
;
56
p.
history_depth
= 1;
57
return
p;
58
}
59
};
60
61
}
// namespace ros2
62
}
// namespace carla
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
carla::ros2::QosProfile
Middleware-neutral QoS profile passed to IPublisherMiddleware::Init / ISubscriberMiddleware::Init whe...
Definition
QosProfile.h:27
carla::ros2::QosProfile::reliability
Reliability reliability
Definition
QosProfile.h:32
carla::ros2::QosProfile::history
History history
Definition
QosProfile.h:34
carla::ros2::QosProfile::history_depth
std::int32_t history_depth
Definition
QosProfile.h:35
carla::ros2::QosProfile::durability
Durability durability
Definition
QosProfile.h:33
carla::ros2::QosProfile::Reliability
Reliability
Definition
QosProfile.h:28
carla::ros2::QosProfile::Reliability::Reliable
@ Reliable
carla::ros2::QosProfile::Reliability::BestEffort
@ BestEffort
carla::ros2::QosProfile::ReliableTransientLocal
static QosProfile ReliableTransientLocal()
RELIABLE / TRANSIENT_LOCAL / KEEP_LAST depth 1 — the profile tier4 uses for the Autoware command subs...
Definition
QosProfile.h:40
carla::ros2::QosProfile::ReliableVolatile
static QosProfile ReliableVolatile()
RELIABLE / VOLATILE / KEEP_LAST depth 1 — the profile tier4 uses for the Autoware report publishers.
Definition
QosProfile.h:51
carla::ros2::QosProfile::Durability
Durability
Definition
QosProfile.h:29
carla::ros2::QosProfile::Durability::Volatile
@ Volatile
carla::ros2::QosProfile::Durability::TransientLocal
@ TransientLocal
carla::ros2::QosProfile::History
History
Definition
QosProfile.h:30
carla::ros2::QosProfile::History::KeepAll
@ KeepAll
carla::ros2::QosProfile::History::KeepLast
@ KeepLast
Generated by
1.9.8