# RLAirsim **Repository Path**: liusky77/RLAirsim ## Basic Information - **Project Name**: RLAirsim - **Description**: airsim2gym - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-06-03 - **Last Updated**: 2026-01-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: 强化学习, Airsim, gym ## README # RLAirsim #### 介绍 将AirSim接口封装为gym环境,作用于无人车,提供reset、step、get_obs、get_state等接口,实现RGB图,深度图、距离传感器和三维点云的处理。 非常感谢Guowei Zou 开源MAPPO算法代码,https://github.com/Guowei-Zou/simple_mappo.git #### 软件架构 软件架构说明 #### 安装教程 1. 需要配置虚幻引擎环境,和VS2022,参见https://www.zhihu.com/column/multiUAV;或者直接使用打包发布的UE4制作的地图,无需额外下载虚幻引擎。 2. 配置settings.json: 详细配置,和相关参数设置,请参考Airsim文档。 >距离传感器说明: >>1. 传感器类型为 5(距离传感器) >>2. 最小检测距离 0.1 米,最大 200 米 >>3. 沿车辆外围均匀分布,水平角度间隔 22.5 度 >>4. 安装高度为 Z=-1.2 米,位于车辆侧面中部 >>5. 每辆车的传感器编号从 DistanceSensor1 到 DistanceSensor16 >>6. "Keyboard"是键盘控制可选项 >>7. 激光雷达传感器类型为6
点击展开settings.json/折叠代码框 ``` { "SeeDocsAt": "https://github.com/Microsoft/AirSim/blob/master/docs/settings.md", "SettingsVersion": 1.2, "SimMode": "Car", "ViewMode": "", "ClockSpeed": 1, "SubWindows": [ { "WindowID": 0, "CameraID": 0, "ImageType": 0, "Visible": true }, { "WindowID": 1, "CameraID": 0, "ImageType": 3, "Visible": false }, { "WindowID": 2, "CameraID": 0, "ImageType": 3, "Visible": true } ], "CameraDefaults": { "CaptureSettings": [ { "ImageType": 3, "Width": 100, "Height": 80, "FOV_Degrees": 90, "AutoExposureSpeed": 100, "AutoExposureBias": 0, "AutoExposureMaxBrightness": 0.64, "AutoExposureMinBrightness": 0.03, "MotionBlurAmount": 0, "TargetGamma": 1.0, "ProjectionMode": "", "OrthoWidth": 5.12 }, { "ImageType": 0, "Width": 256, "Height": 144, "FOV_Degrees": 90, "AutoExposureSpeed": 100, "AutoExposureBias": 0, "AutoExposureMaxBrightness": 0.64, "AutoExposureMinBrightness": 0.03, "MotionBlurAmount": 0, "TargetGamma": 1.0, "ProjectionMode": "", "OrthoWidth": 5.12 } ] }, "Vehicles": { "Car1": { "VehicleType": "PhysXCar", "X": 0, "Y": 0, "Z": -2, "Yaw": 0, "PawnPath": "", "Camera": { "CaptureSettings": [ { "ImageType": 0, "Width": 256, "Height": 144 } ] }, "Keyboard": { "ControlType": 1, "KeyToCommand": [ { "Key": "W", "Command": "Car.Throttle", "Param": 1.0 }, { "Key": "S", "Command": "Car.Throttle", "Param": -1.0 }, { "Key": "A", "Command": "Car.Steering", "Param": -1.0 }, { "Key": "D", "Command": "Car.Steering", "Param": 1.0 } ] }, "Sensors": { "LidarSensor1": { "SensorType": 6, "Enabled": true, "NumberOfChannels": 32, "PointsPerSecond": 100000, "RotationsPerSecond": 10, "HorizontalFOVStart": -90, "HorizontalFOVEnd": 90, "VerticalFOVUpper": 15, "VerticalFOVLower": -45, "Range": 100, "X": 0, "Y": 0, "Z": -1, "Roll": 0, "Pitch": 0, "Yaw": 0 }, "DistanceSensor1": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 1.5, "Y": 0, "Z": -1.2, "Yaw": 0 }, "DistanceSensor2": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 1.5, "Y": 0.7, "Z": -1.2, "Yaw": 45 }, "DistanceSensor3": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 1.5, "Y": 1.2, "Z": -1.2, "Yaw": 90 }, "DistanceSensor4": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 0.7, "Y": 1.5, "Z": -1.2, "Yaw": 135 }, "DistanceSensor5": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 0, "Y": 1.5, "Z": -1.2, "Yaw": 180 }, "DistanceSensor6": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -0.7, "Y": 1.5, "Z": -1.2, "Yaw": 225 }, "DistanceSensor7": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -1.5, "Y": 1.2, "Z": -1.2, "Yaw": 270 }, "DistanceSensor8": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -1.5, "Y": 0.7, "Z": -1.2, "Yaw": 315 }, "DistanceSensor9": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -1.5, "Y": 0, "Z": -1.2, "Yaw": 0 }, "DistanceSensor10": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -1.5, "Y": -0.7, "Z": -1.2, "Yaw": 45 }, "DistanceSensor11": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -1.5, "Y": -1.2, "Z": -1.2, "Yaw": 90 }, "DistanceSensor12": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -0.7, "Y": -1.5, "Z": -1.2, "Yaw": 135 }, "DistanceSensor13": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 0, "Y": -1.5, "Z": -1.2, "Yaw": 180 }, "DistanceSensor14": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 0.7, "Y": -1.5, "Z": -1.2, "Yaw": 225 }, "DistanceSensor15": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 1.5, "Y": -1.2, "Z": -1.2, "Yaw": 270 }, "DistanceSensor16": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 1.5, "Y": -0.7, "Z": -1.2, "Yaw": 315 } } }, "Car2": { "VehicleType": "PhysXCar", "X": 0, "Y": 5, "Z": -2, "Yaw": 0, "PawnPath": "", "Camera": { "CaptureSettings": [ { "ImageType": 0, "Width": 256, "Height": 144 } ] }, "Sensors": { "LidarSensor1": { "SensorType": 6, "Enabled": true, "NumberOfChannels": 32, "PointsPerSecond": 100000, "RotationsPerSecond": 10, "HorizontalFOVStart": -90, "HorizontalFOVEnd": 90, "VerticalFOVUpper": 15, "VerticalFOVLower": -45, "Range": 100, "X": 0, "Y": 0, "Z": -1, "Roll": 0, "Pitch": 0, "Yaw": 0 }, "DistanceSensor1": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 1.5, "Y": 0, "Z": -1.2, "Yaw": 0 }, "DistanceSensor2": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 1.5, "Y": 0.7, "Z": -1.2, "Yaw": 45 }, "DistanceSensor3": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 1.5, "Y": 1.2, "Z": -1.2, "Yaw": 90 }, "DistanceSensor4": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 0.7, "Y": 1.5, "Z": -1.2, "Yaw": 135 }, "DistanceSensor5": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 0, "Y": 1.5, "Z": -1.2, "Yaw": 180 }, "DistanceSensor6": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -0.7, "Y": 1.5, "Z": -1.2, "Yaw": 225 }, "DistanceSensor7": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -1.5, "Y": 1.2, "Z": -1.2, "Yaw": 270 }, "DistanceSensor8": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -1.5, "Y": 0.7, "Z": -1.2, "Yaw": 315 }, "DistanceSensor9": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -1.5, "Y": 0, "Z": -1.2, "Yaw": 0 }, "DistanceSensor10": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -1.5, "Y": -0.7, "Z": -1.2, "Yaw": 45 }, "DistanceSensor11": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -1.5, "Y": -1.2, "Z": -1.2, "Yaw": 90 }, "DistanceSensor12": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -0.7, "Y": -1.5, "Z": -1.2, "Yaw": 135 }, "DistanceSensor13": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 0, "Y": -1.5, "Z": -1.2, "Yaw": 180 }, "DistanceSensor14": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 0.7, "Y": -1.5, "Z": -1.2, "Yaw": 225 }, "DistanceSensor15": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 1.5, "Y": -1.2, "Z": -1.2, "Yaw": 270 }, "DistanceSensor16": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 1.5, "Y": -0.7, "Z": -1.2, "Yaw": 315 } } }, "Car3": { "VehicleType": "PhysXCar", "X": 0, "Y": -5, "Z": -2, "Yaw": 0, "PawnPath": "", "Camera": { "CaptureSettings": [ { "ImageType": 0, "Width": 256, "Height": 144 } ] }, "Sensors": { "LidarSensor1": { "SensorType": 6, "Enabled": true, "NumberOfChannels": 32, "PointsPerSecond": 100000, "RotationsPerSecond": 10, "HorizontalFOVStart": -90, "HorizontalFOVEnd": 90, "VerticalFOVUpper": 15, "VerticalFOVLower": -45, "Range": 100, "X": 0, "Y": 0, "Z": -1, "Roll": 0, "Pitch": 0, "Yaw": 0 }, "DistanceSensor1": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 1.5, "Y": 0, "Z": -1.2, "Yaw": 0 }, "DistanceSensor2": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 1.5, "Y": 0.7, "Z": -1.2, "Yaw": 45 }, "DistanceSensor3": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 1.5, "Y": 1.2, "Z": -1.2, "Yaw": 90 }, "DistanceSensor4": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 0.7, "Y": 1.5, "Z": -1.2, "Yaw": 135 }, "DistanceSensor5": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 0, "Y": 1.5, "Z": -1.2, "Yaw": 180 }, "DistanceSensor6": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -0.7, "Y": 1.5, "Z": -1.2, "Yaw": 225 }, "DistanceSensor7": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -1.5, "Y": 1.2, "Z": -1.2, "Yaw": 270 }, "DistanceSensor8": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -1.5, "Y": 0.7, "Z": -1.2, "Yaw": 315 }, "DistanceSensor9": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -1.5, "Y": 0, "Z": -1.2, "Yaw": 0 }, "DistanceSensor10": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -1.5, "Y": -0.7, "Z": -1.2, "Yaw": 45 }, "DistanceSensor11": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -1.5, "Y": -1.2, "Z": -1.2, "Yaw": 90 }, "DistanceSensor12": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": -0.7, "Y": -1.5, "Z": -1.2, "Yaw": 135 }, "DistanceSensor13": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 0, "Y": -1.5, "Z": -1.2, "Yaw": 180 }, "DistanceSensor14": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 0.7, "Y": -1.5, "Z": -1.2, "Yaw": 225 }, "DistanceSensor15": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 1.5, "Y": -1.2, "Z": -1.2, "Yaw": 270 }, "DistanceSensor16": { "SensorType": 5, "Enabled": true, "MinDistance": 0.1, "MaxDistance": 200, "X": 1.5, "Y": -0.7, "Z": -1.2, "Yaw": 315 } } } } } ```
3. 环境配置: 创建conda 环境python>3.8 ``` pip install msgpack-python pip install setuptools==65.5.0 pip==21 pip install wheel==0.38.0 pip install gym==0.19.0 pip install airsim==1.6.0 ####根据cuda 安装torch ``` #### 使用说明 1. xxxx 2. xxxx 3. xxxx #### 参与贡献 1. 非常感谢Guowei Zou 开源MAPPO算法代码,https://github.com/Guowei-Zou/simple_mappo.git 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)