CARLA
 
载入中...
搜索中...
未找到
RoadInfoLaneMaterial.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
10#include <string>
11
12namespace carla {
13namespace road {
14namespace element {
15
16 class RoadInfoLaneMaterial final : public RoadInfo { // 定义RoadInfoLaneMaterial类,继承自RoadInfo
17 public:
18
19 RoadInfoLaneMaterial( // 构造函数,用于初始化RoadInfoLaneMaterial对象
20 double s, // start position relative to the position of the preceding
21 // lane section
22 std::string surface, // surface参数表示路面的材质类型
23 double friction, // friction参数表示路面的摩擦系数
24 double roughness) // roughness参数表示路面的粗糙度
25 : RoadInfo(s), // 调用基类RoadInfo的构造函数,传递s参数
26 _surface(std::move(surface)), // 初始化路面材质
27 _friction(friction), // 初始化摩擦系数
28 _roughness(roughness) {} // 初始化粗糙度
29
30 void AcceptVisitor(RoadInfoVisitor &v) override final { // AcceptVisitor函数用于接受一个访问者对象v,并将当前对象的控制权交给访问者
31 v.Visit(*this); // 调用访问者的Visit函数,传递当前对象的引用
32 }
33
34 const std::string &GetSurface() const { // 获取路面材质
35 return _surface;
36 }
37
38 double GetFriction() const { // 获取摩擦系数
39 return _friction;
40 }
41
42 double GetRoughness() const { // 获取粗糙度
43 return _roughness;
44 }
45
46 private:
47
48 const std::string _surface; // _surface成员变量用于存储车道的路面材质
49
50 const double _friction; // _friction成员变量用于存储车道的摩擦系数
51
52 const double _roughness; // _roughness成员变量用于存储车道的粗糙度
53 };
54
55} // namespace element
56} // namespace road
57} // namespace carla
void AcceptVisitor(RoadInfoVisitor &v) override final
RoadInfoLaneMaterial(double s, std::string surface, double friction, double roughness)
CARLA模拟器的主命名空间。
Definition Carla.cpp:139