Receiving subscribing data delayed between multiple devices
I'm new to ROS and do not fully understand how its messaging system works.
I have two Raspberry Pi 3's that are communicating with each other over a local network. On one of the pi's, it takes a string input from the user through the console and publishes it to a topic. The other raspberry pi then subscribes to the topic, receives the user-inputted string, edits it, and then prints it to its terminal.
The problem I'm having is when I first publish to the topic, the subscribing node does not take the string data until I publish to the topic for a second time. I would like the subscribing node to edit and print the string as soon as the data is published to the topic. Does anyone know how this could be done?
Seems like either your program somehow ignores the first message or it didn't get it. Rostopic echo the topic you are listening to in the receiving PI before you send it. If it doesn't echo it, it didn't go through. It's impossible to tell what is going wrong from the information you have provided.