AirSim启动设置
windows上的AirSim要想通过PX4进行控制,需要配置一下参数,进入如下路径的AirSim文件,找到settings.json文件,采用记事本打开,并编辑里面的内容。
可以参考如下内容:其中ip要对应,linux上PX4导入的ip即为此处的localhostip,也是WSL服务的ip。
{
"SettingsVersion": 1.2,
"SimMode": "Multirotor",
"ClockType": "SteppableClock",
"Vehicles": {
"PX4": {
"VehicleType": "PX4Multirotor",
"UseSerial": false,
"LockStep": true,
"UseTcp": true,
"TcpPort": 4560,
"ControlIp": "remote",
"ControlPortLocal": 14540,
"ControlPortRemote": 14580,
"LocalHostIp": "172.18.49.113",
"Sensors":{
"Barometer":{
"SensorType": 1,
"Enabled": true,
"PressureFactorSigma": 0.0001825
},
"Imu": {
"SensorType": 2,
"Enabled" : true,
"AngularRandomWalk": 0.3,
"GyroBiasStabilityTau": 500,
"GyroBiasStability": 4.6,
"VelocityRandomWalk": 0.24,
"AccelBiasStabilityTau": 800,
"AccelBiasStability": 36
},
"Gps": {
"SensorType": 3,
"Enabled" : true,
"EphTimeConstant": 0.9,
"EpvTimeConstant": 0.9,
"EphInitial": 25,
"EpvInitial": 25,
"EphFinal": 0.1,
"EpvFinal": 0.1,
"EphMin3d": 3,
"EphMin2d": 4,
"UpdateLatency": 0.2,
"UpdateFrequency": 50,
"StartupDelay": 1
},
"Distance": {
"SensorType": 5,
"Enabled" : true,
"MinDistance": 0.2,
"MaxDistance": 40,
"X": 0, "Y": 0, "Z": -1,
"Yaw": 0, "Pitch": 0, "Roll": 0,
"DrawDebugPoints": false
}
},
"Parameters": {
"NAV_RCL_ACT": 0,
"NAV_DLL_ACT": 0,
"COM_OBL_ACT": 1,
"LPE_LAT": 47.641468,
"LPE_LON": -122.140165
}
}
}
}
配置成功后进入下载并配置AirSim的场景文件中,双击打开启动文件
启动后点击运行,右侧出现等待连接状态