CARLA
Loading...
Searching...
No Matches
CarlaCollisionPublisher.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 CarlaCollisionMsgTraits;
19
20// Publishes carla_msgs::msg::CarlaCollisionEvent. Each event carries the
21// other actor's id and the contact normal impulse (Newton-seconds). The
22// impulse is passed as a float triple so the publisher header does not
23// include carla::geom::Vector3D (which pulls MsgPack + Boost — neither is
24// on the include path of the carla-ros2-native ExternalProject).
26public:
27 CarlaCollisionPublisher(std::string base_topic_name, std::string frame_id);
29
33 CarlaCollisionPublisher &operator=(CarlaCollisionPublisher &&) noexcept = default;
34
35 bool Publish() override;
36 bool Write(
37 std::int32_t seconds,
38 std::uint32_t nanoseconds,
39 std::uint32_t other_actor_id,
40 float impulse_x,
41 float impulse_y,
42 float impulse_z);
43
44private:
46};
47
48} // namespace ros2
49} // namespace carla
std::shared_ptr< PublisherImpl< CarlaCollisionMsgTraits > > _impl
bool Write(std::int32_t seconds, std::uint32_t nanoseconds, std::uint32_t other_actor_id, float impulse_x, float impulse_y, float impulse_z)
CarlaCollisionPublisher & operator=(const CarlaCollisionPublisher &)=delete
CarlaCollisionPublisher(CarlaCollisionPublisher &&) noexcept=default
CarlaCollisionPublisher(const CarlaCollisionPublisher &)=delete
This file contains definitions of common data structures used in traffic manager.