siemens / ros-sharp

ROS# is a set of open source software libraries and tools in C# for communicating with ROS from .NET applications, in particular Unity3D
Apache License 2.0
945 stars 364 forks source link

I cannot build the Unity Mixed Reality Project after adding ROS# #452

Closed tngrbz closed 2 months ago

tngrbz commented 3 months ago

Issue Template © Siemens AG, 2017-2018 Author: Dr. Martin Bischoff (martin.bischoff@siemens.com)

Here is my problem: I am developing a Unity Project for the usage of the mixed reality headsets. I didn't get an error so far. Then, I need to establish a communication with ROS and thus installed ROS#. I went through the tutorials and the fibonacci tutorial worked perfectly. But there was no need of building. However after I built the project it returned with failed with following log errors. I think the only thing I did, which was not mentioned in the tutorials, to make the ROS# Asset to compile, is unchecking the Platforms for plugin boxes.



Perform the following steps reproduce the bug:

Add OVRCameraRig, OVRPassthorughLayer and OVRSceneManager to the project

EditorLogs.txt

memrecakal commented 3 months ago

Hi @tngrbz

Thanks for reaching out. Are you using IL2CPP scripting background in Unity? If so, can you switch to Mono (.NET Framework) and try again?

tngrbz commented 3 months ago

Hi @memrecakal

Thanks for the reply. However it still fails to build for Android. I get the following error. EditorLogs2.txt

memrecakal commented 3 months ago

It seems that recently updated System.Text.Json or Microsoft.Bcl.AsyncInterfaces are not supported on Android, thanks for helping us identify this problem. We suspected this problem and have already downgraded our external dependencies, but the main ros-sharp repo hasn't been updated yet as we are still testing it. Can you please select Newtonsoft_JSON serilaizer in RosConnector and try again?

tngrbz commented 3 months ago

It was already selected like that. Serializer: Newtonsoft_JSON and Protocol: WebSocket Sharp

memrecakal commented 3 months ago

I see. Where did you download ROS# from? Unity asset store or the Github repo?

tngrbz commented 3 months ago

From the GitHub repo.

memrecakal commented 3 months ago

We suspected this problem and have already downgraded our external dependencies, but the main ros-sharp repo hasn't been updated yet as we are still testing it.

As I said, we are still testing the downgraded version before updating the repo again. The Unity Asses Store version is still using the old .NET version with old external libraries. Can you reinstall ROS# from there and test again? I think that should fix the problem. I myself used that particular version to build an Android app and it worked perfectly.

tngrbz commented 3 months ago

Okay I will give it a shot. Thanks for the help. I will share if it solves.

memrecakal commented 3 months ago

@tngrbz Did you make any progress? I'd like to close the issue if so.

tngrbz commented 3 months ago

Hi sorry, I still get an error even after downloading the asset from the unity store. Again I switched to .NET Framework and selected NEWTON_JSON on RosConnector. Here is the error. Logs.txt

memrecakal commented 3 months ago

It seems that Microsoft.Bcl.AsyncInterfaces.dll is still causing problems. From the log I can see that the 'System.Text.Json.dll' is looking for the 1.0.0 version of Microsoft.Bcl.AsyncInterfaces, which might be updated in the new Unity 22 version. After all, the ROS# version you are currently using is built for 19 LTS. The easiest thing to do right now would be to manually download the Microsoft.Bcl.AsyncInterfaces.dll 1.0.0, I think, but this might create an ambiguous reference problem within Unity, still worth a try. If that doesn't solve the problem, I would suggest downgrading to Unity 2019 LTS.

tngrbz commented 3 months ago

Okay, I will give a shot. Since Meta recommends the user to use at least Unity 2022, I will probably look for a different way to use ROS# rather than downgrading. But thanks for the help 👍

memrecakal commented 3 months ago

Hi @tngrbz, were you able to resolve your issue?

tngrbz commented 3 months ago

hi @memrecakal, I needed to extract the position and orientation of the headset, I am just doing it using Oculus App and Meta Link, thus I don't have to build the app, I just have to click on play button on Unity. I tested it works just fine like that.

tngrbz commented 3 months ago

hi @memrecakal, I tried using com.unity.xr.openxr packages which are standard Unity packages, instead of using com.meta.xr.sdk.all, which is the standard Meta package, and it is built fine.