-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Support for multiple drones in Unity #3128
Conversation
It seems that you have a lot of conflicts. This is most likely due to conflicts with autoformatted code in master. Please follow these steps to resolve this:
Thanks for helping us with these style changes! |
Hi @ykeuter! Thank you for applying the clang-format. It seems that there are more conflicts in your PR. If you can solve them, we are ready to test this and merge it. Thanks! |
Hi @jonyMarino ! Thanks for your message. It's been a long time since I worked on this code. I just tried to apply the clang format, but indeed saw there are still conflicts. I will need time to get back into the project. No guarantee on my schedule, but I will keep you posted. |
Hi @jonyMarino ! The merge conflicts are resolved now. I was able to run the |
Thanks, Yvo! We will start testing this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with hello_drone.py and multi_agent_drone.py scripts, which both worked as expected. Looks good apart from minor style comments.
Unity/AirLibWrapper/AirsimWrapper/Source/SimMode/SimModeBase.cpp
Outdated
Show resolved
Hide resolved
Unity/UnityDemo/Assets/AirSimAssets/Scripts/Utilities/AirSimServer.cs
Outdated
Show resolved
Hide resolved
Hi @zimmy87! Thanks for the review and merging this PR. Much appreciated! |
Hi @ykeuter I try to play MultiDroneDemo, but it always make my unity crashed like #4764. whatever the latest airsim version, or this merge version. I also alter my settings.json like https://github.com/microsoft/AirSim/blob/main/PythonClient/multirotor/multi_agent_drone.py .Could you please tell me how can you play the MultiDroneDemo as normal, what the steps. Thanks so much ! |
Hi @SworterW ! Thanks for your message. It has been an awful long time since I looked at this. I do remember that the following point is really important:
Apart from that I do not know if subsequent commits / changes to the code base have broken the multi-drone version. At a later stage I might look back into this. |
Hi @ykeuter ! Thank you for your reply. I find my defalt setting in names of vehicles in the scene is the same as my settings.json. Honestly, i have no clue now. If it's convenient for you, could you please send a version that you play multidrone successfully. Then i will have a new test. Thanks so much!! |
Hi @SworterW ! That is really strange. I was able to install everything from scratch and run |
Hi @ykeuter ! Your reply inspired me a lot. When i built airsim at the beginning, it would spawn setting.json at Document\AirSim\settings.json
|
@SworterW, you probably still have yet another settings file lying around somewhere. The issue is that the dll plugin looks at different locations than the Unity code itself does. I once made a PR to deal with this confusion by using an environment variable: |
Hi @ykeuter ! I'm so sorry to bother you again. I tried this method main...ykeuter:AirSim:settings-env-var |
I also encountered the problem of modifying the json. I added the drone to the drone scene and modified the json file. Adding an additional drone directly at the point (0, 0, 0) is out of control. Did you solve this problem? |
Most of these issues still boil down to stale (auto-generated) settings.json files... Please check for any of those on your machine and take a look at main...ykeuter:AirSim:settings-env-var for some ways to get around this. |
@sandilyasg @pankan2 |
Using multiple vehicles is not yet supported in Unity ( #1540 ). This PR attempts to add this functionality.
A few things to note:
MultiDroneDemo
which can be used withmulti_agent_drone.py
.settings.json
.settings.json
are ignored (as is already the case with a single vehicle).AirSimServer
andAirSimTick
depend on a correct setting of the script execution order.