ihmcrobotics / ihmc-java-ros2-communication

Realtime safe implementation of ROS2 in Java.
Apache License 2.0
21 stars 5 forks source link

Subscription example does not work #16

Open bossenti opened 4 months ago

bossenti commented 4 months ago

I have tried to run your minimal example as shown here with version 0.24.1.

Unfortunately, executing the code results in the following exception:

/xxx/.ihmc/lib/us/ihmc/rtps/impl/fastRTPS/Darwin/arm64/1CB211B43043253419218432CBDD41675C3FD812/libfastrtps.2.6.dylib: dlopen(/xxx/.ihmc/lib/us/ihmc/rtps/impl/fastRTPS/Darwin/arm64/1CB211B43043253419218432CBDD41675C3FD812/libfastrtps.2.6.dylib, 0x0001): Library not loaded: @rpath/libfastcdr.1.dylib
  Referenced from: <C6F987CE-6462-3D02-819F-702521E1576F> /xxx/.ihmc/lib/us/ihmc/rtps/impl/fastRTPS/Darwin/arm64/1CB211B43043253419218432CBDD41675C3FD812/libfastrtps.2.6.dylib
  Reason: tried: '/Users/dextonanderson/projects/ihmc-pub-sub-group/ihmc-pub-sub/buildc/thirdparty/Fast-RTPS-install/lib/libfastcdr.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dextonanderson/projects/ihmc-pub-sub-group/ihmc-pub-sub/buildc/thirdparty/Fast-RTPS-install/lib/libfastcdr.1.dylib' (no such file), '/Users/dextonanderson/projects/ihmc-pub-sub-group/ihmc-pub-sub/buildc/thirdparty/Fast-RTPS-install/lib/libfastcdr.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/dextonanders
Exception in thread "main" java.lang.UnsatisfiedLinkError: 'void us.ihmc.rtps.impl.fastRTPS.FastRTPSJNI.swig_module_init()'
    at us.ihmc.rtps.impl.fastRTPS.FastRTPSJNI.swig_module_init(Native Method)
    at us.ihmc.rtps.impl.fastRTPS.FastRTPSJNI.<clinit>(FastRTPSJNI.java:160)
    at us.ihmc.pubsub.impl.fastRTPS.FastRTPSDomain.<init>(FastRTPSDomain.java:104)
    at us.ihmc.pubsub.impl.fastRTPS.FastRTPSDomain.getInstance(FastRTPSDomain.java:67)
    at us.ihmc.pubsub.DomainFactory.getDomain(DomainFactory.java:38)
    at Test.main(Test.java:14)
ds58 commented 4 months ago

Looks like I probably messed up the linking with those dylib macOS libraries. I'll take a look at this soon and get a fix out.

bossenti commented 4 months ago

Looks like I probably messed up the linking with those dylib macOS libraries. I'll take a look at this soon and get a fix out.

That would be great, thank you!