CARLA
Loading...
Searching...
No Matches
CarlaIMUPublisher.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 CarlaImuMsgTraits;
19
20// Publishes sensor_msgs::msg::Imu. Callers pass accelerometer / gyroscope
21// reading as float triples and a compass heading (radians, magnetic-north
22// clockwise). The orientation quaternion comes from the header-only
23// ImuMath.h seam (PR-1's `a424ff2ec` correction, pinned by
24// test_imu_compass.cpp). Header stays clear of carla::geom::Vector3D
25// because that pulls MsgPack + Boost — neither is on the include path of
26// the carla-ros2-native ExternalProject that compiles these sources.
28public:
29 CarlaIMUPublisher(std::string base_topic_name, std::string frame_id);
31
34 CarlaIMUPublisher(CarlaIMUPublisher &&) noexcept = default;
35 CarlaIMUPublisher &operator=(CarlaIMUPublisher &&) noexcept = default;
36
37 bool Publish() override;
38 bool Write(
39 std::int32_t seconds,
40 std::uint32_t nanoseconds,
41 float accel_x, float accel_y, float accel_z,
42 float gyro_x, float gyro_y, float gyro_z,
43 float compass);
44
45private:
47};
48
49} // namespace ros2
50} // namespace carla
CarlaIMUPublisher(CarlaIMUPublisher &&) noexcept=default
CarlaIMUPublisher & operator=(const CarlaIMUPublisher &)=delete
std::shared_ptr< PublisherImpl< CarlaImuMsgTraits > > _impl
bool Write(std::int32_t seconds, std::uint32_t nanoseconds, float accel_x, float accel_y, float accel_z, float gyro_x, float gyro_y, float gyro_z, float compass)
CarlaIMUPublisher(const CarlaIMUPublisher &)=delete
This file contains definitions of common data structures used in traffic manager.