how to get the latest sensor reading with a subscriber callback takes 3 to 4 seconds

asked 2018-05-17 14:34:42 -0500

ShehabAldeen gravatar image

Hello,

I am using simple package to control nao robot with an EEG sensor

I made two nodes as following

1- Publisher that is reading the sensor values and publish it to a topic called /emoState 2- Subscriber which is reading the values published in the /emoState topic and then move the NAO robot depends on the signal the call back process for a single signal is around 4 seconds

THE PROBLEM IS the subscriber is using the old messages rather than the latest message published by the publisher

how can I make the subscriber to get the latest value published ?

edit retag flag offensive close merge delete

Comments

Hello ShehabAldeen, could you please provide the lines in which you define your publisher and subscriber.

dljubic gravatar image dljubic  ( 2018-05-18 14:24:51 -0500 )edit