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

UnsatisfiedLinkError: tier4_simulation_msgs__rosidl_typesupport_c.dll #186

Open
samanipour opened this issue Jan 24, 2025 · 5 comments
Open

Comments

@samanipour
Copy link

Hi, @mozhoku @SujayAmberkar @Aysenayilmaz @xmfcx if you could help me to solve this issue I would be very appreciated

I'm trying to setup AWSIM-Lab as Unity Project on Windows

System setup:

When I run the demo I got the following error, it seems the error raised from

UnsatisfiedLinkError: tier4_simulation_msgs__rosidl_typesupport_c.dll ROS2.DllLoadUtilsWindowsDesktop.ROS2.DllLoadUtils.LoadLibraryNoSuffix (System.String fileName) (at <c2fd60e12ae74b49b3633ef9563fbe65>:0) tier4_simulation_msgs.msg.DummyObject..cctor () (at <875a1a567ccc4ffe8e2115395ef84ff7>:0) Rethrow as TypeInitializationException: The type initializer for 'tier4_simulation_msgs.msg.DummyObject' threw an exception. (wrapper write-barrier) System.Object.wbarrier_conc(intptr) System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) (at <51fded79cd284d4d911c5949aff4cb21>:0) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) (at <51fded79cd284d4d911c5949aff4cb21>:0) System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) (at <51fded79cd284d4d911c5949aff4cb21>:0) System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache) (at <51fded79cd284d4d911c5949aff4cb21>:0) System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) (at <51fded79cd284d4d911c5949aff4cb21>:0) System.Activator.CreateInstance[T] () (at <51fded79cd284d4d911c5949aff4cb21>:0) ROS2.Subscription1[T]..ctor (System.String subTopic, ROS2.Node node, System.Action1[T] cb, ROS2.QualityOfServiceProfile qos) (at <2034886caef046439cfa6ebcd9ed8cd7>:0) ROS2.Node.CreateSubscription[T] (System.String topic, System.Action1[T] callback, ROS2.QualityOfServiceProfile qos) (at <2034886caef046439cfa6ebcd9ed8cd7>:0)
ROS2.ROS2Node.CreateSubscription[T] (System.String topicName, System.Action1[T] callback, ROS2.QualityOfServiceProfile qos) (at Assets/Ros2ForUnity/Scripts/ROS2Node.cs:92) AWSIM.SimulatorROS2Node.CreateSubscription[T] (System.String topicName, System.Action1[T] callback, ROS2.QualityOfServiceProfile qos) (at Assets/AWSIM/Scripts/ROS/SimulatorROS2Node.cs:86)
AWSIM.RVIZNPCSpawner.Start () (at Assets/AWSIM/Scripts/NPCs/RvizNPCSpawner/RVIZNPCSpawner.cs:53)`

Image

I should also mentioned that there are some other errors related to missing RobotecGPULidar which could be solved by the following proposed solution in this issue.

@SujayAmberkar
Copy link
Member

Hi @samanipour, the error you are facing is in the RVIZNPCSpawnner.cs file over here:

void Start()
        {
            // Initialize the ROS2 node and create the subscription
            dummyPerceptionSubscriber
                = SimulatorROS2Node.CreateSubscription<tier4_simulation_msgs.msg.DummyObject>(
                        dummyPerceptionTopic, OnObjectInfoReceived, qosSettings.GetQoSProfile());
        }

I think this error occurs because it is unable to subscribe to tier4_simulation_msgs.msg.DummyObject, likely due to the missing tier4_simulation_msgs__rosidl_typesupport_c.dll or its dependencies, as it says. Could you try rebuilding Autoware, since the issue is probably not on the Unity side but rather due to an incomplete Autoware build?

@samanipour
Copy link
Author

samanipour commented Jan 24, 2025

@SujayAmberkar Thanks for your response,
yes the error caused by RVIZNPCSpawnner.cs but I think the tier4_simulation_msgs__rosidl_typesupport_c.dll should be part of Ros2ForUnity, because if you check AWSIM-Labs\Assets\Ros2ForUnity\Plugins\Linux\x86_64 you could see the equivalent library as libtier4_simulation_msgs__rosidl_typesupport_c.so for Linux. So I though maybe the tier4_simulation_msgs__rosidl_typesupport_c.dll should be exists in AWSIM-Labs\Assets\Ros2ForUnity\Plugins\Windows\x86_64, am I wrong?

by try to rebuilding Autoware, you mean I should build Autoware separately and run it while AWSIM-Lab runs? (I should also mentioned that as I checked before tier4_simulation_msgs__rosidl_typesupport_c.dll is not exists ether in Autoware project nor original AWSIM main branch )

@SujayAmberkar
Copy link
Member

SujayAmberkar commented Jan 24, 2025

@samanipour Ahh yes, you're right. libtier4_simulation_msgs__rosidl_typesupport_c must be present in \windows\x86_64. No need to rebuild autoware, try reinstalling ros2-for-unity for windows https://github.com/RobotecAI/ros2-for-unity/blob/develop/README-WINDOWS.md I was using linux so it worked for me out of the box.

I removed libtier4_simulation_msgs__rosidl_typesupport_c.so and libtier4_simulation_msgs__rosidl_typesupport_cpp.so from my plugins folder and it gave me the same error, so that confirms it.

Image

@samanipour
Copy link
Author

@SujayAmberkar
Thanks!
I'm curious why libtier4_simulation_msgs__rosidl_typesupport_c is not included in the official ros2-for-unity window build release (https://github.com/RobotecAI/ros2-for-unity/releases).

Given its absence, I'm concerned that following the build instructions you provided (https://github.com/RobotecAI/ros2-for-unity/blob/develop/README-WINDOWS.md) might not generate the DLL we need.

Do you have any insights into why this library is missing or how we can ensure the build process includes it?

@SujayAmberkar
Copy link
Member

@samanipour I'm not really sure about it. Maybe you can ask this question in ros2-for-unity's repo.

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