CARLA
Loading...
Searching...
No Matches
LibCarla
source
carla
ros2
publishers
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
9
#include "
carla/ros2/publishers/BasePublisher.h
"
10
11
#include <cstdint>
12
#include <memory>
13
14
namespace
carla
{
15
namespace
ros2 {
16
17
template
<
typename
Traits>
class
PublisherImpl;
18
struct
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.
27
class
CarlaIMUPublisher
:
public
BasePublisher
{
28
public
:
29
CarlaIMUPublisher
(std::string base_topic_name, std::string frame_id);
30
~CarlaIMUPublisher
()
override
;
31
32
CarlaIMUPublisher
(
const
CarlaIMUPublisher
&) =
delete
;
33
CarlaIMUPublisher
&
operator=
(
const
CarlaIMUPublisher
&) =
delete
;
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
45
private:
46
std
::shared_ptr<
PublisherImpl
<
CarlaImuMsgTraits
>>
_impl
;
47
};
48
49
}
// namespace ros2
50
}
// namespace carla
BasePublisher.h
carla::ros2::BasePublisher
Definition
BasePublisher.h:14
carla::ros2::CarlaIMUPublisher
Definition
CarlaIMUPublisher.h:27
carla::ros2::CarlaIMUPublisher::CarlaIMUPublisher
CarlaIMUPublisher(CarlaIMUPublisher &&) noexcept=default
carla::ros2::CarlaIMUPublisher::Publish
bool Publish() override
Definition
CarlaIMUPublisher.cpp:32
carla::ros2::CarlaIMUPublisher::operator=
CarlaIMUPublisher & operator=(const CarlaIMUPublisher &)=delete
carla::ros2::CarlaIMUPublisher::_impl
std::shared_ptr< PublisherImpl< CarlaImuMsgTraits > > _impl
Definition
CarlaIMUPublisher.h:46
carla::ros2::CarlaIMUPublisher::~CarlaIMUPublisher
~CarlaIMUPublisher() override
carla::ros2::CarlaIMUPublisher::Write
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)
Definition
CarlaIMUPublisher.cpp:36
carla::ros2::CarlaIMUPublisher::CarlaIMUPublisher
CarlaIMUPublisher(const CarlaIMUPublisher &)=delete
carla::ros2::PublisherImpl
Definition
PublisherImpl.h:28
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
std
Definition
CarlaRecorderCollision.h:31
carla::ros2::CarlaImuMsgTraits
Definition
CarlaIMUPublisher.cpp:17
Generated by
1.9.8