方法一:根据官方文档配置json文件
创建多架无人机#
{
"SettingsVersion": 1.2,
"SimMode": "Multirotor",
"Vehicles": {
"Drone1": {
"VehicleType": "SimpleFlight",
"X": 4, "Y": 0, "Z": -2,
"Yaw": -180
},
"Drone2": {
"VehicleType": "SimpleFlight",
"X": 8, "Y": 0, "Z": -2
}
}
}
方法二:看官方示例hellodronepawn.cpp
里面调用SimaddVehicle
https://github.com/microsoft/AirSim/blob/main/HelloSpawnedDrones/HelloSpawnedDrones.cpp