CARLA
 
载入中...
搜索中...
未找到
VehicleDoor.h
浏览该文件的文档.
1// Copyright (c) 2021 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/MsgPack.h"// 包含 MsgPack 相关的头文件,可能用于序列化、反序列化等与消息打包相关的功能(具体取决于其内部实现)
10
11#include <cstdint>// 引入标准库中用于处理固定宽度整数类型的头文件,这里主要可能会用到其中的一些整数类型定义等功能
12
13namespace carla {// 定义 carla 命名空间,代码应该是属于 carla 项目相关的内容,在这个命名空间下对各类功能进行组织
14namespace rpc {// 进一步定义 rpc 子命名空间,可能用于存放远程过程调用(RPC)相关的类、函数等实现
15
16 enum class VehicleDoor : uint8_t { // 定义一个名为 VehicleDoor 的枚举类型,它继承自无符号 8 位整数类型(uint8_t)
17 // 用于表示车辆的门的类型,通过不同的枚举值来区分车辆的各个门以及特殊的门状态
18 FL = 0,// 前门左侧(Front Left)
19 FR = 1, // 前门右侧(Front Right)
20 RL = 2,// 后门左侧(Rear Left)
21 RR = 3, // 后门右侧(Rear Right)
22 Hood = 4, // 引擎盖(Hood)
23 Trunk = 5, // 后备箱(Trunk)
24 All = 6 // 所有门(All,表示一种特殊状态,可能用于同时操作所有门的情况)
25 };
26
27} // namespace rpc
28} // namespace carla
29//使用 MSGPACK_ADD_ENUM 宏(可能是由 "carla/MsgPack.h" 头文件提供)将 VehicleDoor 枚举类型注册到 MsgPack 的序列化/反序列化机制中
30// 这样就可以方便地对 VehicleDoor 类型的变量进行消息打包和解包操作,以便在网络传输或数据存储等场景中使用
MSGPACK_ADD_ENUM(carla::rpc::VehicleDoor)
CARLA模拟器的主命名空间。
Definition Carla.cpp:139