CARLA
 
载入中...
搜索中...
未找到
client/Junction.h
浏览该文件的文档.
1// Copyright (c) 2020 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/Memory.h" // 引入内存管理相关的头文件
10#include "carla/NonCopyable.h" // 引入不可复制类的头文件
11#include "carla/road/Junction.h" // 引入道路交叉口的相关定义
12#include "carla/road/RoadTypes.h" // 引入道路交叉口的相关定义
13#include "carla/geom/BoundingBox.h" // 引入边界框的相关定义
14#include "carla/client/Waypoint.h" // 引入路径点的相关定义
15
16#include <vector> // 引入标准库中的向量容器
17
18
19namespace carla { // 定义carla命名空间
20namespace client { // 定义client命名空间
21
22 class Map; // 前向声明Map类
23
24 class Junction // 定义Junction类
25 : public EnableSharedFromThis<Junction>, // 允许共享自身的指针
26 private NonCopyable // 禁止拷贝构造
27 {
28 public:
29
30 carla::road::JuncId GetId() const { // 获取交叉口ID
31 return _id; // 返回交叉口ID
32 }
33
34 std::vector<std::pair<SharedPtr<Waypoint>,SharedPtr<Waypoint>>> GetWaypoints( // 获取路径点
35 road::Lane::LaneType type = road::Lane::LaneType::Driving) const; // 默认类型为行驶道
36
37 geom::BoundingBox GetBoundingBox() const; // 获取交叉口的边界框
38
39 private:
40
41 friend class Map; // 声明Map类为友元类,允许其访问私有成员
42
43 Junction(SharedPtr<const Map> parent, const road::Junction *junction); // 构造函数
44
45 SharedPtr<const Map> _parent; // 父地图的共享指针
46
47 geom::BoundingBox _bounding_box; // 交叉口的边界框
48
49 road::JuncId _id; // 交叉口ID
50 };
51
52} // namespace client
53} // namespace carla
地图类的前向声明,用于在LaneInvasionSensor类中可能的引用。
这个类用于禁止拷贝和移动构造函数及赋值操作
std::vector< std::pair< SharedPtr< Waypoint >, SharedPtr< Waypoint > > > GetWaypoints(road::Lane::LaneType type=road::Lane::LaneType::Driving) const
Definition Junction.cpp:19
geom::BoundingBox GetBoundingBox() const
Definition Junction.cpp:24
carla::road::JuncId GetId() const
geom::BoundingBox _bounding_box
SharedPtr< const Map > _parent
LaneType
可以作为标志使用
Definition Lane.h:29
int32_t JuncId
Definition RoadTypes.h:23
carla::SharedPtr< carla::client::Junction > Junction
CARLA模拟器的主命名空间。
Definition Carla.cpp:139
boost::shared_ptr< T > SharedPtr
使用这个SharedPtr(boost::shared_ptr)以保持与boost::python的兼容性, 但未来如果可能的话,我们希望能为std::shared_ptr制作一个Python适配器。
Definition Memory.h:19
包含CARLA客户端相关类和函数的命名空间。