lambdaprime / jros2client

Java module to interact with ROS2 (Robot Operating System)
5 stars 3 forks source link

Can't connect to port 0 #10

Closed lambdaprime closed 7 months ago

lambdaprime commented 8 months ago

This DOESN'T happen when creating a publisher node in the same process as the subscriber, so it doesn't seem to be an issue with the datatype any more. I can move this to another issue if you'd prefer.

     [java] Feb 01, 2024 12:51:52 PM pinorobotics.rtpstalk.impl.spec.userdata.DataReader#967576586-00000104
     [java] SEVERE: Cannot open connection to remote writer on { "transportType": "LOCATOR_KIND_INVALID", "port": "0", "address": "/0.0.0.0" }
     [java] java.lang.RuntimeException: Cannot open connection to remote writer on { "transportType": "LOCATOR_KIND_INVALID", "port": "0", "address": "/0.0.0.0" }
     [java]     at pinorobotics.rtpstalk.impl.spec.behavior.reader.WriterProxy.getDataChannel(WriterProxy.java:179)
     [java]     at pinorobotics.rtpstalk.impl.behavior.reader.WriterHeartbeatProcessor.lambda$ack$0(WriterHeartbeatProcessor.java:115)
     [java]     at java.base/java.util.Optional.ifPresent(Optional.java:178)
     [java]     at pinorobotics.rtpstalk.impl.behavior.reader.WriterHeartbeatProcessor.ack(WriterHeartbeatProcessor.java:115)
     [java]     at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
     [java]     at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
     [java]     at java.base/java.util.concurrent.ConcurrentHashMap$ValueSpliterator.forEachRemaining(ConcurrentHashMap.java:3612)
     [java]     at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
     [java]     at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
     [java]     at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
     [java]     at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
     [java]     at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
     [java]     at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
     [java]     at pinorobotics.rtpstalk.impl.spec.behavior.reader.StatefullReliableRtpsReader.process(StatefullReliableRtpsReader.java:221)
     [java]     at pinorobotics.rtpstalk.impl.spec.behavior.reader.RtpsReader.onNext(RtpsReader.java:241)
     [java]     at pinorobotics.rtpstalk.impl.spec.behavior.reader.RtpsReader.onNext(RtpsReader.java:80)
     [java]     at java.base/java.util.concurrent.SubmissionPublisher$BufferedSubscription.consumeNext(SubmissionPublisher.java:1354)
     [java]     at java.base/java.util.concurrent.SubmissionPublisher$BufferedSubscription.takeItems(SubmissionPublisher.java:1343)
     [java]     at java.base/java.util.concurrent.SubmissionPublisher$BufferedSubscription.consume(SubmissionPublisher.java:1300)
     [java]     at java.base/java.util.concurrent.SubmissionPublisher$ConsumerTask.run(SubmissionPublisher.java:978)
     [java]     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
     [java]     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
     [java]     at java.base/java.lang.Thread.run(Thread.java:840)
     [java] Caused by: java.net.SocketException: Can't connect to port 0
     [java]     at java.base/sun.nio.ch.DatagramChannelImpl.connect(DatagramChannelImpl.java:1239)
     [java]     at java.base/sun.nio.ch.DatagramChannelImpl.connect(DatagramChannelImpl.java:1207)
     [java]     at pinorobotics.rtpstalk.impl.spec.transport.DataChannelFactory.connect(DataChannelFactory.java:124)
     [java]     at pinorobotics.rtpstalk.impl.spec.behavior.reader.WriterProxy.getDataChannel(WriterProxy.java:177)
     [java]     ... 22 more
     [java] 

Originally posted by @marlow-fawn in https://github.com/lambdaprime/jros2client/issues/9#issuecomment-1921945202

lambdaprime commented 8 months ago

Hi @marlow-fawn,

Thanks for trying jrosclient

We are looking into it and update you during the weekends

lambdaprime commented 8 months ago

Hi @marlow-fawn,

Unfortunately we could not reproduce the problem.

Could you please enable debug mode and send the logs.

Thank you,

armadilloz commented 8 months ago

I'm seeing this same error when running my client in a Docker container on a Pi. This is not reproducing for me on any other platform though. Can help with troubleshooting if needed.

lambdaprime commented 8 months ago

Hi @armadilloz

Thanks for trying jrosclient

Could you please enable debug mode and send the logs since we could not reproduce it.

Thank you,

armadilloz commented 8 months ago

Here are the logs: jros2java.zip

lambdaprime commented 8 months ago

Hi @armadilloz,

We could reproduce the problem and are working on a fix. ETA is early next week.

Meanwhile you could try to workaround this problem by running ROS2 nodes with: export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

Regards,

lambdaprime commented 8 months ago

Hi @marlow-fawn @armadilloz ,

The fix is ready and will be included in v6 we plan to release early March. Until then you can use prerelease version You will need to install it manually

Regards,

lambdaprime commented 7 months ago

Hi @armadilloz @marlow-fawn @bibistellar,

We just published a new v6 release where this issue is fixed. In new release there are changes to messages metadata. If you have custom message classes defined then please regenerate them with msgmonster first. If you don't have custom messages then you can ignore it.

Regards,