CARLA
Loading...
Searching...
No Matches
Acceleration.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 geom {
13
14 /// Linear acceleration in metres per second squared. Inherits `Vector3D`
15 /// storage and arithmetic and carries unit semantics so consumers do not
16 /// silently mix `cm/s^2` and `m/s^2` payloads at API boundaries.
18
19 Acceleration() = default;
20
21 constexpr Acceleration(float ix, float iy, float iz)
22 : Vector3D(ix, iy, iz) {
23 }
24
25 explicit constexpr Acceleration(const Vector3D &v)
26 : Vector3D(v) {
27 }
28
29#ifdef LIBCARLA_INCLUDED_FROM_UE4
30
31 /// Build an `Acceleration` (m/s^2) from an Unreal `FVector` expressed in
32 /// centimetres per second squared.
33 explicit Acceleration(const FVector &a_cm_per_s2)
34 : Vector3D(
35 static_cast<float>(a_cm_per_s2.X) * 1e-2f,
36 static_cast<float>(a_cm_per_s2.Y) * 1e-2f,
37 static_cast<float>(a_cm_per_s2.Z) * 1e-2f) {
38 }
39
40 /// Return this `Acceleration` as an Unreal `FVector` in centimetres per
41 /// second squared.
43 return FVector{x * 1e2f, y * 1e2f, z * 1e2f};
44 }
45
46#endif // LIBCARLA_INCLUDED_FROM_UE4
47 };
48
49} // namespace geom
50} // namespace carla
This file contains definitions of common data structures used in traffic manager.
Linear acceleration in metres per second squared.
constexpr Acceleration(const Vector3D &v)
Acceleration(const FVector &a_cm_per_s2)
Build an Acceleration (m/s^2) from an Unreal FVector expressed in centimetres per second squared.
constexpr Acceleration(float ix, float iy, float iz)
FVector ToFVectorCmPerSecondSquared() const
Return this Acceleration as an Unreal FVector in centimetres per second squared.