CARLA
Loading...
Searching...
No Matches
AckermannControlConversion.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
11namespace carla {
12namespace ros2 {
13
14// Converts the five scalar fields of a ROS ackermann_msgs/AckermannDriveStamped
15// message payload into the CARLA AckermannControl POD. The wire-side
16// AckermannDriveStamped FastDDS type is decomposed in AckermannControlSubscriber.cpp;
17// this seam exists so the numeric mapping can be exercised by a unit test that does
18// not link FastDDS.
20 float steering_angle,
21 float steering_angle_velocity,
22 float speed,
23 float acceleration,
24 float jerk) {
25 AckermannControl control{};
26 control.steer = steering_angle;
27 control.steer_speed = steering_angle_velocity;
28 control.speed = speed;
29 control.acceleration = acceleration;
30 control.jerk = jerk;
31 return control;
32}
33
34} // namespace ros2
35} // namespace carla
AckermannControl FromAckermannDrive(float steering_angle, float steering_angle_velocity, float speed, float acceleration, float jerk)
This file contains definitions of common data structures used in traffic manager.