CARLA
Loading...
Searching...
No Matches
ZenohSharedSession.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#ifndef CARLA_ROS2_MIDDLEWARE_TESTING
8#ifdef CARLA_ROS2_MIDDLEWARE_ZENOH
9
10#include <zenoh.h>
11
12#include <string>
13
14namespace carla {
15namespace ros2 {
16
17/// Return a loaned pointer to the process-wide shared Zenoh Session, opened
18/// lazily on the first call and kept alive for the process lifetime. All
19/// Zenoh publishers and subscribers attach to this Session; the carla_bridge
20/// node liveliness token is declared as a side effect so rmw_zenoh peers
21/// list the node in their graph cache.
22const z_loaned_session_t* zenoh_get_shared_session();
23
24/// Hex string form of the shared Session's ZID, suitable for rmw_zenoh
25/// liveliness keyexprs. Cached after first call.
26const std::string& zenoh_session_zid();
27
28} // namespace ros2
29} // namespace carla
30
31#endif // CARLA_ROS2_MIDDLEWARE_ZENOH
32#endif // !CARLA_ROS2_MIDDLEWARE_TESTING
This file contains definitions of common data structures used in traffic manager.