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// TRANSIENT_LOCAL / KEEP_LAST depth 1 per tier4):
25// /control/command/control_cmd autoware_control_msgs/Control
26// /control/command/gear_cmd autoware_vehicle_msgs/GearCommand
27// /control/command/turn_indicators_cmd autoware_vehicle_msgs/TurnIndicatorsCommand
28// /control/command/hazard_lights_cmd autoware_vehicle_msgs/HazardLightsCommand
29// /control/command/emergency_cmd tier4_vehicle_msgs/VehicleEmergencyStamped
30// /vehicle/engage autoware_vehicle_msgs/Engage
31//
32// Control application (tier4 AutowareController::GetControl): only
33// longitudinal.acceleration drives the vehicle (velocity/jerk intentionally
34// ignored — pure acceleration control); steer =
35// GetSteeringInput(-steering_tire_angle) via the compensation LUT; steer_speed
36// = -steering_tire_rotation_rate when defined, else 0. The remaining commands
37// are drained each frame but not yet applied (tier4 TODO preserved for the
38// Unreal phase).
40public:
41 AutowareControlSubscriber(void *vehicle, std::string frame_id);
43
44 /// Drains the six command topics once per frame (called from
45 /// ROS2::SetFrame like every BaseSubscriber). Fires the actor callback with
46 /// a VehicleAccelerationControl when any command topic has news.
47 void ProcessMessages(ActorCallback callback) override;
48
49protected:
51
52private:
53 class Impl;
54 std::shared_ptr<Impl> _impl;
55};
56
57} // namespace ros2
58} // namespace carla
void ProcessMessages(ActorCallback callback) override
Drains the six command topics once per frame (called from ROS2::SetFrame like every BaseSubscriber).
std::function< void(void *actor, ROS2CallbackData data)> ActorCallback
std::variant< VehicleControl, AckermannControl, VehicleAccelerationControl > ROS2CallbackData
This file contains definitions of common data structures used in traffic manager.