Reading from topic once using rospy.wait_for_message()
Hi,
I want to read a message from a topic once, thus I tried to use wait_for_message()
like this:
topic_name = "/yumi/rws/system_states"
system_info = rospy.wait_for_message(topic_name, SystemState, timeout=5)
but the timeout was reached, and I couldn't read a message from the topic!
The topic is publishing messages, and I was able to check them from the terminal using:
rostopic echo "/yumi/rws/system_states"
, how can I read a message from the topic once? thanks in advance.
Can you tell me what error you are getting?