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

Unity build improvements #2328

Merged
merged 12 commits into from
Apr 30, 2020
Merged

Conversation

rajat2004
Copy link
Contributor

@rajat2004 rajat2004 commented Nov 27, 2019

  1. Add clean.sh
  2. Add autogenerated files and folders to .gitignore (https://github.com/github/gitignore/blob/master/Unity.gitignore)
  3. Various fixes in build.sh
  4. Fixes in Unity CMakeLists.txt, add detection of Boost
  5. Add files not included in .gitignore - manifest.json
  6. Updated assets to Unity 2019 (Will be regenerated if needed for other versions)
  7. Fix Unity crash on starting
  8. Windows - create Assets folder if doesn't exist

TODO:

  1. Hundreds of Compilation warnings (Issue Hundreds of warnings while compiling AirSim for Unity on Linux #2478, would be great to get a look at that)

Done:

  1. Fix Unity compilation (PR Unity: Placeholder functions for compilation #2514)
  2. Update .sln files to VS 2019 (PR Upgrade Windows Unity project to VS 2019 #2515)

@rajat2004 rajat2004 force-pushed the unity-buil-improvements branch 2 times, most recently from 50feeeb to a28c6f0 Compare December 2, 2019 16:18
@rajat2004
Copy link
Contributor Author

rajat2004 commented Dec 2, 2019

There is still one file: ProjectVersion.txt, which changes based on the Unity version, but since that is similar to the .uproject file for Unreal, therefore didn't add that

Also, an extra settings.json file is getting created in the main directory if the settings.json in Documents/AirSim is not present, there's an open PR for this - #2303, though I haven't tested it

@rajat2004 rajat2004 force-pushed the unity-buil-improvements branch 2 times, most recently from fe5a447 to 282af06 Compare January 5, 2020 09:45
@rajat2004 rajat2004 mentioned this pull request Jan 5, 2020
@rajat2004 rajat2004 force-pushed the unity-buil-improvements branch 2 times, most recently from b2fc924 to 00e13e6 Compare January 6, 2020 08:56
@rajat2004
Copy link
Contributor Author

rajat2004 commented Jan 6, 2020

The RPC CMake file in Unity is modified from the rpclib's CMakeLists.txt, which has the same error, and has been fixed in the fork which is used in #2340

Edit: Attached is the output in the current form of the branch, captured using
./build.sh &> output.txt
I suspect compiler flags from a different build such as from LLVM are also being applied
output.txt

@sytelus
Copy link
Contributor

sytelus commented Jan 18, 2020

Looks good to me but haven't tested it. @madratman - please feel free to merge this.

@rajat2004
Copy link
Contributor Author

@sytelus Thanks for the review! I've tested this on Ubuntu 18.04 with the latest version of Unity available (2019.2.17f1)

@rajat2004
Copy link
Contributor Author

There are two .asset files which were generated by Unity, along with a settings.json in the root directory if the settings.json in Documents/AirSim is not present, and modification of ProjectVersion.txt.
These were out of the scope of this, and so am not adding them. The creation of settings.json is a bug which needs to be fixed

@madratman
Copy link
Contributor

there's a commit for a sharedlib in there (Unity/UnityDemo/Assets/Plugins/libAirsimWrapper.so.meta).
Why is that needed?

@rajat2004
Copy link
Contributor Author

@madratman This was the part I was confused about, there's already a .meta file for the DLL generated on Windows, so either that can be removed or following the logic, on Linux, the .so file is generated with it's associated .meta file, which is being added
Not sure which one is correct, I don't have Unity setup on Windows currently so can't test that right now, but I think removing the .dll.meta file instead of adding the .so.meta file should also work
In that case, the entire folder can be put into .gitignore

@madratman
Copy link
Contributor

Hmmm, my guess is the commit-ment of the .dll.meta was a human error. Not 100% sure atm. Will get back to you.

@rajat2004 rajat2004 force-pushed the unity-buil-improvements branch 2 times, most recently from 08eff00 to e892c18 Compare March 27, 2020 11:02
@rajat2004
Copy link
Contributor Author

Rebased on master, as can be seen (or not seen), the Travis PR build is not appearing

@rajat2004
Copy link
Contributor Author

If the problem still persists, an option could be to update the Unity version in docs and the project files in PR

@sebastian-ruiz
Copy link

On Windows, running Unity 2019.2.17f1 I get 100s of logs in the unity console log:

Control Mode:  Keyboard Vehicle=PhysXCar
UnityEngine.Debug:Log(Object)

When I try and run hello_car.py and running the Unity demo, it can connect, however the car doesn't move.

@rajat2004
Copy link
Contributor Author

This PR currently just fixes compilation errors, some annoyances and the crash on starting
Further changes would probably need follow-up PR, contributions would definitely be very much welcome

@rajat2004
Copy link
Contributor Author

I think several people have been using this PR for Unity, and it seems to work atleast for not crashing at the beginning itself
If the problem with the older one still persists, then maybe the docs could be updated to use the later version on Linux

@saihv
Copy link
Contributor

saihv commented Apr 30, 2020

I am able to run this fine in Unity 2019.3.12 in Ubuntu (seemingly released yesterday). No compilation errors - but I do see the barrage of warnings with all sorts of obscure compiler flags; I cannot seem to find the origin of these through grep.

EDIT: Found the cause, discussion in #2478

image

Looks like Unity Hub for Ubuntu is also new? (The AirSim instructions don't mention it). Perhaps we should upgrade the Unity assets to target 2019.3 and merge.

@madratman
Copy link
Contributor

Thanks @saihv! I think let's update the assets, and merge it.
And also update the links in doc

@madratman madratman merged commit f37af51 into microsoft:master Apr 30, 2020
@madratman
Copy link
Contributor

madratman commented Apr 30, 2020

Interestingly

{
  "SettingsVersion": 1.2,
  "SimMode": "Multirotor",
   "Vehicles": {
      "Drone1": {
          "VehicleType": "simpleflight"
          }
      }
  }

results in crash

but

{
  "SettingsVersion": 1.2,
  "SimMode": "Multirotor"
}

works

Maybe this is the issue I was running in to.

@rajat2004 rajat2004 deleted the unity-buil-improvements branch May 1, 2020 01:23
@rajat2004
Copy link
Contributor Author

Thanks a lot for testing and merging @saihv @madratman
Regarding the settings, there does seem to quite a lot of issues with them with Unity, such as Simmode not being changed, etc.
There is a PR open which maybe fixes these issues, #2303, I haven't tested it myself

@rajat2004 rajat2004 restored the unity-buil-improvements branch May 1, 2020 01:27
@rajat2004 rajat2004 deleted the unity-buil-improvements branch May 1, 2020 01:33
@higho51420
Copy link

On windows i run unity Demo on 2019.3.12f,use keyboard the car can movie ,but when i run the hello_car.py,it connect ,no error ,normal output:speed,Go forward,steer right~~~~~,the car in the scene doesn't move. i really want to know how to solve it. when i use 2018.2.15,it didn't occur thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants