CARLA
 
载入中...
搜索中...
未找到
RoadInfoLaneAccess.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
9#include "carla/road/element/RoadInfo.h" // 引入RoadInfo类的头文件
10#include <string> // 引入字符串类的头文件
11
12namespace carla { // 定义carla命名空间
13namespace road { // 定义road命名空间
14namespace element { // 定义element命名空间
15
16 /// 此记录定义了某些类型道路使用者的访问限制。
17 /// 该记录可用于补充来自标志或信号的限制,以控制场景中的交通流。
18 /// 每个条目在s坐标增加的方向上有效,直到定义新的条目。
19 /// 如果定义了多个条目,它们必须按增加顺序列出。
20 class RoadInfoLaneAccess final : public RoadInfo { // 定义RoadInfoLaneAccess类,继承自RoadInfo
21 public:
22
23 // 构造函数,接受起始位置和限制字符串
25 double s, // 相对于前一车道段的位置的起始位置
26 std::string restriction) // 限制的描述
27 : RoadInfo(s), // 调用基类构造函数
28 _restriction(restriction) {} // 初始化限制字符串
29
30 // 接受访问者模式的访问器
32 v.Visit(*this); // 调用访问者的Visit方法
33 }
34
35 // 获取限制字符串
36 const std::string &GetRestriction() const {
37 return _restriction; // 返回限制字符串的引用
38 }
39
40 private:
41
42 const std::string _restriction; // 限制字符串,例如:Simulator、Autonomous Traffic、Pedestrian 和 None
43 };
44
45} // namespace element
46} // namespace road
47} // namespace carla
此记录定义了某些类型道路使用者的访问限制。 该记录可用于补充来自标志或信号的限制,以控制场景中的交通流。 每个条目在s坐标增加的方向上有效,直到定义新的条目。 如果定义了多个条目,它们必须按增加顺序列出...
RoadInfoLaneAccess(double s, std::string restriction)
const std::string & GetRestriction() const
void AcceptVisitor(RoadInfoVisitor &v) final
CARLA模拟器的主命名空间。
Definition Carla.cpp:139