CARLA
Loading...
Searching...
No Matches
RoadInfoLateralShape.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
11
12namespace carla {
13namespace road {
14namespace element {
15
16 /// One <lateralProfile><shape> record: at station s, the road surface
17 /// height relative to the elevation profile is a cubic polynomial in
18 /// (t - t_record), valid from t_record until the next record at the same
19 /// station. Together the records describe the road cross-section (crown,
20 /// banking); reconstructed real-world maps rely on them for crossing
21 /// roads to agree on surface height inside junctions.
22 class RoadInfoLateralShape final : public RoadInfo {
23 public:
24
26 double s,
27 double t,
28 double a,
29 double b,
30 double c,
31 double d)
32 : RoadInfo(s),
33 _t(t),
34 _shape(a, b, c, d, t) {}
35
37 v.Visit(*this);
38 }
39
40 double GetT() const {
41 return _t;
42 }
43
44 /// Evaluate the surface height offset at lateral position t (the
45 /// polynomial is defined over t - t_record).
46 double Evaluate(const double t) const {
47 return _shape.Evaluate(t);
48 }
49
51 return _shape;
52 }
53
54 private:
55
56 const double _t;
57
59 };
60
61} // namespace element
62} // namespace road
63} // namespace carla
std::map< std::string, unsigned int > road
Describes a Cubic Polynomial so: f(x) = a + bx + cx^2 + dx^3.
value_type Evaluate(const value_type &x) const
Evaluates f(x) = a + bx + cx^2 + dx^3.
One <lateralProfile><shape> record: at station s, the road surface height relative to the elevation p...
RoadInfoLateralShape(double s, double t, double a, double b, double c, double d)
double Evaluate(const double t) const
Evaluate the surface height offset at lateral position t (the polynomial is defined over t - t_record...
const geom::CubicPolynomial & GetPolynomial() const
void AcceptVisitor(RoadInfoVisitor &v) final
This file contains definitions of common data structures used in traffic manager.