Airsim: Controlling multiple vehicles from Python

Created on 6 Jun 2018  Â·  12Comments  Â·  Source: microsoft/AirSim

I've spend a lot of time trying to control multiple vehicles (quadrotors) using the most recent version of AirSim (1.1.10) from Python. The instruction in "multi_vehicel.md" doesn't work for the "simple_flight" controller; I can only control the first flying pawn from Python. Is this a bug or is there something wrong with my settings in "settings.json"? Here are my settings:

    {
        "SeeDocsAt": "https://github.com/Microsoft/AirSim/blob/master/docs/settings.md",
        "SettingsVersion": 1.0,
        "DefaultVehicleConfig": "SimpleFlight",

        "SimpleFlight": {
            "FirmwareName": "SimpleFlight",
            "DefaultVehicleState": "Armed",
            "ApiServerPort": 41451
        },
        "SimpleFlight_1": {
            "FirmwareName": "SimpleFlight",
            "DefaultVehicleState": "Armed",
            "ApiServerPort": 41452
        }
    }

I would really appreciate any help! Thanks!

P.S. I've read and tried #664 and other multi-agent issues, but none of them worked so far.

multi-agent

Most helpful comment

We have been doing ton of refactoring to make APIs more clean and add multi-vehicle capabilities. All the core code for this is now pushed and we are testing this capability now.

All 12 comments

You may refer to this:
https://github.com/stephen-jang/AirSim
and this:

1008

A month ago, a premature (i.e., both vehicles cannot land simultaneously :( ) multi vehicle code was there in the master AirSim branch but now it has been disappeared. Anyhow, that code allocates different port numbers to multiple vehicle. You can control multi vehicles using swarmControl.py from stephen-jang's fork.

Don't be confused; multi_vehicle.md is totally outdated. Setting up settings.json does not work.

I am also waiting for the mature multi-vehicle capability in the near future.

@galgyeony , I followed your instructions and got it working! I can't thank you enough! Also, a big thanks to @stephen-jang.

We have been doing ton of refactoring to make APIs more clean and add multi-vehicle capabilities. All the core code for this is now pushed and we are testing this capability now.

Thanks @sytelus ! I'll look forward to using the multi-agent capability in the new version.

@sytelus Thank you so much! By the way, I have a question. Do the new multi-vehicle capabilities work on one machine (like stand-alone mode) or on multiple machines simultaneously (like client-server based network games)?

@KavehFathian hello, do you succeed in adding another vehicle and controlling them?

@JordanWang0223 Yes. You can see a video of it here:
https://www.youtube.com/watch?v=g1btgkqcKg8

This was done by following what galgyeony mentioned above. You can also try the new version of AirSim, it should work with multiple vehicles.

@sytelus I tested the multi-vehicle capability in the new version of AirSim. It works great! You have done an amazing job. Here is a video of it that we're including in a journal paper:
https://youtu.be/AMXbX1Ezg8Q

@KavehFathian I watched your nice video clip. Congratulations. I have two questions.

First, how many drones can operate smoothly (e.g., without any delay) while moving and taking images? In your video clip, you tested 9 drones but what is the maximum number? And can you give me the spec. (CPU, GPU, RAM, SSD, etc.) of your test machine? Note that in my workstation(with 1080 GPU), more than 5 drones cannot be simulated smoothly (when performing moving and taking images) since simulation delay is observed.

Second, if I am correct, current AirSim implementation allows to move only "4" drones at the same time even though you want to move "9" drones simultaneously (e.g., it means if you want 9, then 4->4->1 drones move sequentially). For your test, did you change the source code so that 9 drones can actually fly at the same time?

@galgyeony Thanks.

I'm running this on a relatively old laptop workstation (Dell Precision M4800). Here are the specs:
https://dell.com/en-us/work/shop/dell-laptops-and-notebooks/precision-m4800/spd/precision-m4800-workstation

I've noted the sequence 4->4->1 when the drones were taking off. While sending the motion control commands this was not notable for me and it seemed that they are moving simultaneously. I didn't modify the source code, and this is based on the newest version of AirSim. If you are having trouble it might be due to using an older version.

Hi @KavehFathian,

They are both very interesting videos, Can you tell the title of the paper which you've published and is the code opensource?
Also, did you find any way to make them all take off at the same time?

Thanks and Regards
Yash Kaushal

Was this page helpful?
0 / 5 - 0 ratings