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

namespace 'UrdfImporter' does not exist in 'Unity.Robotics' #228

Open
FabianEP11 opened this issue Sep 25, 2024 · 3 comments
Open

namespace 'UrdfImporter' does not exist in 'Unity.Robotics' #228

FabianEP11 opened this issue Sep 25, 2024 · 3 comments

Comments

@FabianEP11
Copy link

I have a Unity project with the URDF-Importer plugin (v0.5.2), and I need to get the name of the joints from code like this:

string joint_name = articulationBody.gameObject.GetComponent<UrdfJointRevolute>().jointName;
which uses using Unity.Robotics.UrdfImporter .

When I run the app in the Editor everything works fine, but when I build the app, it fails because it cannot fine the namespace:

The type or namespace name 'UrdfImporter' does not exist in the namespace 'Unity.Robotics' (are you missing an assembly reference?)

I also tried adding the entire namespace to the GetComponent type like: string joint_name = articulationBody.gameObject.GetComponent<Unity.Robotics.UrdfImporter.UrdfJointRevolute>().jointName; but it is the same

Is the using Unity.Robotics.UrdfImporter just available on the Editor? or how can I fix that?

@CarlTornberg
Copy link

The URDF importer needs to compile for whichever build target you have set (In my case, I use Android).

First, move the URDF importer package from the CachedPackage folder to the asset package folder:

  1. Find the package by: Project -> Packages -> URDF Importer
  2. Right-click and press Show in explorer, ctrl+x the URDF folder,
  3. Paste in the Asset/Packages by: Project -> Assets
  4. Right-click and press Show in explorer.
  5. Paste in the Packages folder

When the package is moved, let it recompile and find the package in the editor.
Project -> Packages -> URDF Importer -> Runtime -> Unity.Robotics.URDFImporter -> (In the inspector) Click with platform you are compiling to -> Apply.

Image

@FabianEP11
Copy link
Author

Hey,
Yeah, previously I was able to build the app for a HoloLens device by manually adding "WSA" to the "includePlatforms" in the "Library\PackageCache\com.unity.robotics.urdf-importer@90f353e\Runtime\Unity.Robotics.URDFImporter.asmdef" file.
I guess that the inspector checkbox changes the same file.

Thanks!

@CarlTornberg
Copy link

CarlTornberg commented Nov 19, 2024

Further more, Im not sure if this is for all build platforms, but is for Android.
An exception named 'Packages/com.unity.robotics.urdf-importer/Runtime/UnityMeshImporter/Plugins/AssimpNet/Native/win/x86/assimp.dll' (Key: assimp.dll;None) since plugin with the same name and architecture was already added ('Packages/com.unity.robotics.urdf-importer/Runtime/UnityMeshImporter/Plugins/AssimpNet/Native/win/x86_64/assimp.dll (Architecture: None)') fails the build.
Here is the solution to that issue
Note that you do not have to remove the files, and can just check "Android" as an excluded build platform for the assimp
Image

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

No branches or pull requests

2 participants