ROS 2 zero copy intraprocess communication
I've written a program to measure the latency of communication between separate ROS 2 foxy publisher and a subscriber nodes running in a single process. I'm dynamically allocating memory for the message using make_unique() and passing to publish(). My understanding was that this would result in zero-copy communication to the subscriber. However, the latency seems high and the memory address of the underlying message at the subscriber is different than the address of the originally allocated message. A similar test using shared pointer publish with nodelets in ROS 1 shows the memory address is unchanged at the receiver (i.e. zero-copy occurred).
My code is at: https://github.com/mschickler/simple_...
Any help or insight appreciated.