CARLA
Loading...
Searching...
No Matches
AutowareGNSSPublisher.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
17// Port of tier4's AutowareGNSSPublisher: a dual-topic pose publisher fed by
18// the Autoware GNSS sensor. Publishes the sensor's *world* transform (plus an
19// optional MGRS map offset) instead of geodetic coordinates:
20// <base_topic>/pose geometry_msgs/Pose (bare pose, no header)
21// <base_topic>/pose_with_covariance geometry_msgs/PoseWithCovarianceStamped
22// frame_id (used in the stamped message header) is "map" per tier4's design.
23// QoS RELIABLE / VOLATILE / KEEP_LAST depth 1 per tier4.
24// Dual-topic structure mirrors CarlaCameraPublisher (image_raw + camera_info).
26public:
27 AutowareGNSSPublisher(std::string base_topic_name, std::string frame_id);
29
32
33 /// Fill both pose messages from the sensor's CARLA world transform
34 /// (translation in meters, rotation pitch/yaw/roll in degrees) plus the
35 /// MGRS map-origin offset in meters. Pass {0,0,0} offsets when no
36 /// georeference is configured.
37 bool Write(
38 std::int32_t seconds,
39 std::uint32_t nanoseconds,
40 float tx, float ty, float tz,
41 float pitch_deg, float yaw_deg, float roll_deg,
42 double mgrs_offset_x, double mgrs_offset_y, double mgrs_offset_z);
43
44 /// Publishes both topics.
45 bool Publish() override;
46
47private:
48 class Impl;
49 std::shared_ptr<Impl> _impl;
50};
51
52} // namespace ros2
53} // namespace carla
AutowareGNSSPublisher(const AutowareGNSSPublisher &)=delete
AutowareGNSSPublisher & operator=(const AutowareGNSSPublisher &)=delete
bool Publish() override
Publishes both topics.
bool Write(std::int32_t seconds, std::uint32_t nanoseconds, float tx, float ty, float tz, float pitch_deg, float yaw_deg, float roll_deg, double mgrs_offset_x, double mgrs_offset_y, double mgrs_offset_z)
Fill both pose messages from the sensor's CARLA world transform (translation in meters,...
This file contains definitions of common data structures used in traffic manager.