ConcurrentModificationException in rosjava
I am occasionally getting a ConcurrentModificationException
exception when running rosjava. It happens when serializing the tfMessage
. I am publishing tf messages at 10hz.
The stack trace is:
Exception in thread "pool-1-thread-14" java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:782)
at java.util.ArrayList$Itr.next(ArrayList.java:754)
at org.ros.message.tf.tfMessage.serialize(Unknown Source)
at org.ros.message.Message.serialize(Unknown Source)
at org.ros.internal.message.old_style.MessageSerializer.serialize(MessageSerializer.java:39)
at org.ros.internal.transport.OutgoingMessageQueue.writeMessageToChannel(OutgoingMessageQueue.java:79)
at org.ros.internal.transport.OutgoingMessageQueue.access$100(OutgoingMessageQueue.java:38)
at org.ros.internal.transport.OutgoingMessageQueue$Writer.loop(OutgoingMessageQueue.java:56)
at org.ros.concurrent.CancellableLoop.run(CancellableLoop.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)
Is this a known problem, and is there any way to circumvent it?
I also sometimes getting buffer overflow exceptions in the same code.
This only seems to affect tf messages. I have not seen the problem with any other messages that I am publishing.
I checked out rosjava on March 2nd. I am on Ubuntu 11.10 using ROS electric.
I notice that the stack trace indicates that I am using the old style message serializer. Is there a way to use the new style message serializer?