CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
ros2
middleware
ActiveMiddleware.h
Go to the documentation of this file.
1
// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB).
2
// This work is licensed under the terms of the MIT license.
3
// For a copy, see <https://opensource.org/licenses/MIT>.
4
5
#pragma once
6
7
#include <string>
8
9
#include "
carla/ros2/middleware/Middleware.h
"
10
#include "
carla/ros2/middleware/MiddlewareConfig.h
"
11
12
namespace
carla
{
13
namespace
ros2
{
14
15
/// DDS-free bridge for selecting the active middleware across the shared-library
16
/// boundary.
17
///
18
/// ROS2.cpp is the only ROS 2 translation unit compiled into carla-server; every
19
/// other ROS 2 source (including MiddlewareFactory.h and the vendor middleware
20
/// headers) is compiled exclusively into libcarla-ros2-native.so. These
21
/// declarations include only Middleware.h, so carla-server can select the
22
/// middleware without any DDS header crossing the boundary. The definitions are
23
/// compiled into the shared library.
24
25
/// Resolve and select the requested middleware.
26
/// @return true if the middleware was compiled into the shared library and is now
27
/// active, false if it is unavailable (in which case the active middleware is
28
/// left unchanged).
29
bool
SetActiveMiddleware
(
Middleware
requested);
30
31
/// @return A readable list of the middleware implementations compiled into the
32
/// shared library. Must be resolved inside the shared library because the
33
/// CARLA_ROS2_MIDDLEWARE_* macros are defined only on the carla-ros2-native
34
/// target, not on carla-server.
35
std::string
GetAvailableMiddleware
();
36
37
/// Store the domain id in the shared library's MiddlewareConfig and return the
38
/// effective domain id resolved there, so carla-server can log the value the
39
/// middlewares will actually use. Pass kUnsetDomainId to keep each middleware's
40
/// native default. Like the other exports here, this is DDS-free and its
41
/// definition is compiled into the shared library, so MiddlewareConfig's
42
/// process-wide storage lives on the shared-library side that the middlewares
43
/// read.
44
ResolvedDomainId
SetActiveDomainId
(
int
domain_id);
45
46
}
// namespace ros2
47
}
// namespace carla
MiddlewareConfig.h
Middleware.h
carla::ros2
Definition
AutowareSteeringCompensation.h:15
carla::ros2::GetAvailableMiddleware
std::string GetAvailableMiddleware()
Definition
ActiveMiddleware.cpp:19
carla::ros2::Middleware
Middleware
Enumeration of available middleware implementations.
Definition
Middleware.h:15
carla::ros2::SetActiveMiddleware
bool SetActiveMiddleware(Middleware requested)
DDS-free bridge for selecting the active middleware across the shared-library boundary.
Definition
ActiveMiddleware.cpp:11
carla::ros2::SetActiveDomainId
ResolvedDomainId SetActiveDomainId(int domain_id)
Store the domain id in the shared library's MiddlewareConfig and return the effective domain id resol...
Definition
ActiveMiddleware.cpp:23
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
carla::ros2::ResolvedDomainId
The resolved domain id together with the source it came from.
Definition
MiddlewareConfig.h:42
Generated by
1.18.0