CARLA
Loading...
Searching...
No Matches
BasicPublisher.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 <memory>
12#include <string>
13
14namespace carla {
15namespace ros2 {
16
17template <typename Traits> class PublisherImpl;
18struct BasicPublisherMsgTraits;
19
20// Developer scaffold: publishes a std_msgs::String to a fixed topic
21// (`rt/basic_publisher_example`). Only reachable from the WITH_ROS2_DEMO
22// code paths in ROS2.cpp, but compiles unconditionally so the
23// carla-ros2-native ExternalProject can pick it up.
25public:
27 ~BasicPublisher() override;
28
29 BasicPublisher(const BasicPublisher &) = delete;
31 BasicPublisher(BasicPublisher &&) noexcept = default;
32 BasicPublisher &operator=(BasicPublisher &&) noexcept = default;
33
34 bool Init();
35 bool Publish() override;
36 void SetData(const std::string &msg);
37
38private:
40};
41
42} // namespace ros2
43} // namespace carla
BasicPublisher(BasicPublisher &&) noexcept=default
BasicPublisher & operator=(const BasicPublisher &)=delete
std::shared_ptr< PublisherImpl< BasicPublisherMsgTraits > > _impl
BasicPublisher(const BasicPublisher &)=delete
void SetData(const std::string &msg)
This file contains definitions of common data structures used in traffic manager.