CARLA
 
载入中...
搜索中...
未找到
RoadInfoElevation.h
浏览该文件的文档.
1// Copyright (c) 2017 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 class RoadInfoElevation final : public RoadInfo {
17 public:
18
20 double s,
21 double a, // elevation
22 double b, // slope
23 double c, // vertical_curvature
24 double d) // curvature_change
25 : RoadInfo(s),
26 _elevation(a, b, c, d, s) {}
27
29 v.Visit(*this);
30 }
31
32 /// @todo unused? you can use the polynomial directly.
33 double Evaluate(const double dist, double &out_tan) const {
34 out_tan = _elevation.Tangent(dist);
35 return _elevation.Evaluate(dist);
36 }
37
39 return _elevation;
40 }
41
42 private:
43
45 };
46
47} // namespace element
48} // namespace road
49} // namespace carla
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
value_type Tangent(const value_type &x) const
Evaluates the tangent using df/dx = b + 2cx + 3dx^2
void AcceptVisitor(RoadInfoVisitor &v) final
const geom::CubicPolynomial & GetPolynomial() const
const geom::CubicPolynomial _elevation
double Evaluate(const double dist, double &out_tan) const
RoadInfoElevation(double s, double a, double b, double c, double d)
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133