Convert function to inline to avoid duplicates with image_transport