CARLA
 
载入中...
搜索中...
未找到
Junction.cpp
浏览该文件的文档.
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#include "carla/client/Junction.h" // 引入Junction头文件
8#include "carla/client/Map.h" // 引入Map头文件
9#include "carla/road/element/Waypoint.h" // 引入Waypoint头文件
10
11namespace carla { // 定义carla命名空间
12namespace client { // 定义client子命名空间
13
14 Junction::Junction(SharedPtr<const Map> parent, const road::Junction *junction) : _parent(parent) { // Junction构造函数
15 _bounding_box = junction->GetBoundingBox(); // 获取并存储交叉口的边界框
16 _id = junction->GetId(); // 获取并存储交叉口的ID
17 }
18
19 std::vector<std::pair<SharedPtr<Waypoint>, SharedPtr<Waypoint>>> Junction::GetWaypoints( // 获取交叉口的路点
20 road::Lane::LaneType type) const { // 输入参数:车道类型
21 return _parent->GetJunctionWaypoints(GetId(), type); // 从父Map获取与交叉口相关的路点
22 }
23
24 geom::BoundingBox Junction::GetBoundingBox() const { // 获取交叉口的边界框
25 return _bounding_box; // 返回存储的边界框
26 }
27
28} // namespace client
29} // namespace carla
carla::road::JuncId GetId() const
geom::BoundingBox _bounding_box
SharedPtr< const Map > _parent
JuncId GetId() const
carla::geom::BoundingBox GetBoundingBox() const
LaneType
可以作为标志使用
Definition Lane.h:29
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客户端相关类和函数的命名空间。