CARLA
Loading...
Searching...
No Matches
AutowareVehicleStatusPublisher.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 AutowarePublisher: the six Autoware vehicle report
18// publishers, re-expressed through PublisherImpl / IPublisherMiddleware
19// instead of tier4's per-publisher Fast-DDS scaffolding
20// (AutowarePublisherBase.hpp — superseded).
21//
22// Topics (fixed absolute names, DDS "rt/" prefix, frame_id "base_link",
23// QoS RELIABLE / VOLATILE / KEEP_LAST depth 1 per tier4):
24// /vehicle/status/velocity_status autoware_vehicle_msgs/VelocityReport
25// /vehicle/status/steering_status autoware_vehicle_msgs/SteeringReport
26// /vehicle/status/control_mode autoware_vehicle_msgs/ControlModeReport
27// /vehicle/status/gear_status autoware_vehicle_msgs/GearReport
28// /vehicle/status/turn_indicators_status autoware_vehicle_msgs/TurnIndicatorsReport
29// /vehicle/status/hazard_lights_status autoware_vehicle_msgs/HazardLightsReport
30
31// https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_vehicle_msgs/msg/ControlModeReport.msg
41
42// https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_vehicle_msgs/msg/GearReport.msg
43enum class Gear {
44 NONE,
45 NEUTRAL,
46 DRIVE,
47 DRIVE_2,
48 DRIVE_3,
49 DRIVE_4,
50 DRIVE_5,
51 DRIVE_6,
52 DRIVE_7,
53 DRIVE_8,
54 DRIVE_9,
64 REVERSE,
66 PARK,
67 LOW,
68 LOW_2
69};
70
72 OFF,
73 LEFT,
74 RIGHT
75};
76
78public:
81
84
85 void SetVelocity(float longitudinal_velocity, float lateral_velocity, float heading_rate);
86 /// @param steering_tire_angle CARLA-side steering value; the inverse
87 /// compensation LUT (GetSteeringOutput) is applied before publishing so
88 /// Autoware sees the actual tire angle.
89 void SetSteering(float steering_tire_angle);
90 void SetControlMode(ControlMode mode);
91 void SetGear(Gear gear);
93 void SetHazardLights(bool hazard_lights_enabled);
94
95 /// Stamp all six pending reports with (seconds, nanoseconds) and publish
96 /// them at once — all reports share the same frequency, matching AWSIM.
97 bool Publish(std::int32_t seconds, std::uint32_t nanoseconds);
98
99 /// BasePublisher interface; publishes with the last stamp given to the
100 /// two-argument overload (0,0 before the first call).
101 bool Publish() override;
102
103private:
104 class Impl;
105 std::shared_ptr<Impl> _impl;
106 std::int32_t _seconds{0};
107 std::uint32_t _nanoseconds{0};
108};
109
110} // namespace ros2
111} // namespace carla
AutowareVehicleStatusPublisher & operator=(const AutowareVehicleStatusPublisher &)=delete
bool Publish() override
BasePublisher interface; publishes with the last stamp given to the two-argument overload (0,...
void SetVelocity(float longitudinal_velocity, float lateral_velocity, float heading_rate)
AutowareVehicleStatusPublisher(const AutowareVehicleStatusPublisher &)=delete
This file contains definitions of common data structures used in traffic manager.