CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
road
element
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
9
#include "
carla/road/element/RoadInfo.h
"
10
#include "
carla/geom/CubicPolynomial.h
"
11
12
namespace
carla
{
13
namespace
road
{
14
namespace
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
25
RoadInfoLateralShape
(
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
36
void
AcceptVisitor
(
RoadInfoVisitor
&v)
final
{
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
50
const
geom::CubicPolynomial
&
GetPolynomial
()
const
{
51
return
_shape
;
52
}
53
54
private
:
55
56
const
double
_t
;
57
58
const
geom::CubicPolynomial
_shape
;
59
};
60
61
}
// namespace element
62
}
// namespace road
63
}
// namespace carla
CubicPolynomial.h
RoadInfo.h
carla::geom::CubicPolynomial
Describes a Cubic Polynomial so: f(x) = a + bx + cx^2 + dx^3.
Definition
CubicPolynomial.h:18
carla::geom::CubicPolynomial::Evaluate
value_type Evaluate(const value_type &x) const
Evaluates f(x) = a + bx + cx^2 + dx^3.
Definition
CubicPolynomial.h:106
carla::road::element::RoadInfoLateralShape::RoadInfoLateralShape
RoadInfoLateralShape(double s, double t, double a, double b, double c, double d)
Definition
RoadInfoLateralShape.h:25
carla::road::element::RoadInfoLateralShape::Evaluate
double Evaluate(const double t) const
Evaluate the surface height offset at lateral position t (the polynomial is defined over t - t_record...
Definition
RoadInfoLateralShape.h:46
carla::road::element::RoadInfoLateralShape::GetPolynomial
const geom::CubicPolynomial & GetPolynomial() const
Definition
RoadInfoLateralShape.h:50
carla::road::element::RoadInfoLateralShape::GetT
double GetT() const
Definition
RoadInfoLateralShape.h:40
carla::road::element::RoadInfoLateralShape::_shape
const geom::CubicPolynomial _shape
Definition
RoadInfoLateralShape.h:58
carla::road::element::RoadInfoLateralShape::AcceptVisitor
void AcceptVisitor(RoadInfoVisitor &v) final
Definition
RoadInfoLateralShape.h:36
carla::road::element::RoadInfoLateralShape::_t
const double _t
Definition
RoadInfoLateralShape.h:56
carla::road::element::RoadInfoVisitor
Definition
RoadInfoVisitor.h:33
carla::road::element::RoadInfo::RoadInfo
RoadInfo(double distance=0.0)
Definition
RoadInfo.h:34
carla::road::element
Definition
SignComponent.h:26
carla::road
Definition
SignComponent.h:23
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
Generated by
1.18.0