CARLA
Loading...
Searching...
No Matches
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
11
12namespace carla {
13namespace 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).
29bool 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.
35std::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.
45
46} // namespace ros2
47} // namespace carla
std::string GetAvailableMiddleware()
Middleware
Enumeration of available middleware implementations.
Definition Middleware.h:15
bool SetActiveMiddleware(Middleware requested)
DDS-free bridge for selecting the active middleware across the shared-library boundary.
ResolvedDomainId SetActiveDomainId(int domain_id)
Store the domain id in the shared library's MiddlewareConfig and return the effective domain id resol...
This file contains definitions of common data structures used in traffic manager.
The resolved domain id together with the source it came from.