CARLA
Loading...
Searching...
No Matches
AutowareControlSubscriber.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 <memory>
10#include <string>
11
14
15namespace carla {
16namespace ros2 {
17
18// Port of tier4's AutowareController: the six Autoware command subscribers,
19// re-expressed through SubscriberImpl / ISubscriberMiddleware instead of
20// tier4's AutowareSubscriber / SubscriberListenerBase Fast-DDS scaffolding
21// (superseded).
22//
23// Topics (fixed absolute names, DDS "rt/" prefix, QoS RELIABLE /
24// VOLATILE / KEEP_LAST depth 1, which matches TRANSIENT_LOCAL and VOLATILE
25// command writers alike):
26// /control/command/control_cmd autoware_control_msgs/Control
27// /control/command/gear_cmd autoware_vehicle_msgs/GearCommand
28// /control/command/turn_indicators_cmd autoware_vehicle_msgs/TurnIndicatorsCommand
29// /control/command/hazard_lights_cmd autoware_vehicle_msgs/HazardLightsCommand
30// /control/command/emergency_cmd tier4_vehicle_msgs/VehicleEmergencyStamped
31// /vehicle/engage autoware_vehicle_msgs/Engage
32//
33// Control application (tier4 AutowareController::GetControl): only
34// longitudinal.acceleration drives the vehicle (velocity/jerk intentionally
35// ignored — pure acceleration control); steer =
36// GetSteeringInput(-steering_tire_angle) via the compensation LUT; steer_speed
37// = -steering_tire_rotation_rate when defined, else 0. The remaining commands
38// are drained each frame but not yet applied (tier4 TODO preserved for the
39// Unreal phase).
41public:
42 AutowareControlSubscriber(void *vehicle, std::string frame_id);
44
45 /// Drains the six command topics once per frame (called from
46 /// ROS2::SetFrame like every BaseSubscriber). Fires the actor callback with
47 /// a VehicleAccelerationControl when any command topic has news.
48 void ProcessMessages(ActorCallback callback) override;
49
50protected:
52
53private:
54 class Impl;
55 std::shared_ptr<Impl> _impl;
56};
57
58} // namespace ros2
59} // namespace carla
AutowareControlSubscriber(void *vehicle, std::string frame_id)
void ProcessMessages(ActorCallback callback) override
Drains the six command topics once per frame (called from ROS2::SetFrame like every BaseSubscriber).
std::variant< VehicleControl, AckermannControl, VehicleAccelerationControl > ROS2CallbackData
std::function< void(void *actor, ROS2CallbackData data)> ActorCallback
This file contains definitions of common data structures used in traffic manager.