CARLA
 
载入中...
搜索中...
未找到
CarlaServerResponse.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// 包含CarlaServerResponse相关的头文件,推测其中定义了ECarlaServerResponse枚举类型等相关内容
9
10// 函数CarlaGetStringError用于根据给定的ECarlaServerResponse枚举值返回对应的错误描述字符串
11// 参数Response是一个ECarlaServerResponse类型的枚举值,表示不同的服务器响应状态
13{
14 // 使用switch语句根据不同的Response枚举值来返回相应的错误描述字符串
15 switch (Response)
16 {
17 // 当Response为Success时,表示操作成功,返回对应的成功提示字符串"Sucess"(此处单词拼写有误,正确应为"Success",可后续修正)
19 return "Sucess";
20 // 当Response为ActorNotFound时,表示在注册表中找不到对应的Actor(游戏等场景中的角色、实体等概念),返回相应错误描述
22 return "Actor could not be found in the registry";
23 // 当Response为ComponentNotFound时,表示在这个Actor中找不到对应的组件,返回相应错误描述
25 return "Component could not be found in this actor";
26 // 当Response为ActorTypeMismatch时,表示Actor与期望的类型不匹配,返回相应错误描述
28 return "Actor does not match the expected type";
29 // 当Response为MissingActor时,表示Actor缺失了,返回相应错误描述
31 return "Actor is missing";
32 // 当Response为NotAVehicle时,表示该Actor不是车辆类型,返回相应错误描述
34 return "Actor is not a Vehicle";
35 // 当Response为WalkerDead时,表示行人(Walker通常可理解为行人角色)已经死亡,返回相应错误描述
37 return "Walker is already dead";
38 // 当Response为NotAWalker时,表示该Actor不是行人类型,返回相应错误描述
40 return "Actor is not a Walker";
41 // 当Response为WalkerIncompatibleController时,表示行人有不兼容的控制器,返回相应错误描述
43 return "Walker has incompatible controller";
44 // 当Response为NullActor时,表示Actor为空,返回相应错误描述
46 return "Actor is null";
47 // 当Response为AutoPilotNotSupported时,表示该Actor不支持自动驾驶功能,返回相应错误描述
49 return "Autopilot is not supported by the Actor";
50 // 当Response为CarSimPluginNotEnabled时,表示汽车模拟插件未启用,返回相应错误描述
52 return "CarSim plugin is not enabled";
53 // 当Response为NotATrafficLight时,表示该Actor不是交通信号灯,返回相应错误描述
55 return "Actor is not a traffic light";
56 // 当Response为FunctionNotAvailiableWhenDormant时,表示当Actor处于休眠状态时该函数不可用,返回相应错误描述
58 return "Function not availiable when the actor is dormant";
59 }
60 // 如果传入的Response枚举值不匹配上述任何已定义的情况,返回默认的"unknown error"表示未知错误
61 return "unknown error";
62}
FString CarlaGetStringError(ECarlaServerResponse Response)
ECarlaServerResponse