Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controlling multiple vehicles from Python #1137

Closed
KavehFathian opened this issue Jun 6, 2018 · 12 comments
Closed

Controlling multiple vehicles from Python #1137

KavehFathian opened this issue Jun 6, 2018 · 12 comments

Comments

@KavehFathian
Copy link

KavehFathian commented Jun 6, 2018

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.

@galgyeony
Copy link

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.

@KavehFathian
Copy link
Author

KavehFathian commented Jun 7, 2018

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

@sytelus
Copy link
Contributor

sytelus commented Jun 23, 2018

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.

@KavehFathian
Copy link
Author

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

@galgyeony
Copy link

@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)?

@JordanWang0223
Copy link

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

@KavehFathian
Copy link
Author

@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.

@KavehFathian
Copy link
Author

KavehFathian commented Aug 2, 2018

@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

@galgyeony
Copy link

galgyeony commented Aug 2, 2018

@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?

@KavehFathian
Copy link
Author

@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.

@yashkaushal
Copy link

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

@KavehFathian
Copy link
Author

@msb336 msb336 closed this as completed Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants