CARLA
Loading...
Searching...
No Matches
CarlaClockPublisher.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
10
11#include <cstdint>
12#include <memory>
13
14namespace carla {
15namespace ros2 {
16
17template <typename Traits> class PublisherImpl;
18struct CarlaClockMsgTraits;
19
20// Global ROS 2 clock publisher: writes rosgraph_msgs::msg::Clock to the
21// well-known "rt/clock" topic. Single-instance — ROS2::Enable() constructs
22// it once and SetTimestamp() drives every tick.
24public:
27
31 CarlaClockPublisher &operator=(CarlaClockPublisher &&) noexcept = default;
32
33 bool Publish() override;
34 bool Write(std::int32_t seconds, std::uint32_t nanoseconds);
35
36private:
38};
39
40} // namespace ros2
41} // namespace carla
CarlaClockPublisher(const CarlaClockPublisher &)=delete
std::shared_ptr< PublisherImpl< CarlaClockMsgTraits > > _impl
CarlaClockPublisher & operator=(const CarlaClockPublisher &)=delete
bool Write(std::int32_t seconds, std::uint32_t nanoseconds)
CarlaClockPublisher(CarlaClockPublisher &&) noexcept=default
This file contains definitions of common data structures used in traffic manager.