ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

big delay between publisher and subscriber !

asked 2018-05-17 11:06:42 -0600

ShehabAldeen gravatar image

updated 2018-05-17 11:39:35 -0600

ahendrix gravatar image

I made a package to control the nao robot using the Emotic EPOC+ EEG sensor to drive the robot depends on the facial expressions

basically my package consist of two nodes 1- Publisher : which read the values coming from the sensor using the Emotiv SDK and then publish which expression I am doing with my face in a topic named /emoState

2- Subscriber : which read from that topic and give the commands to the nao robot using its SDK

the problem is my publisher is too fast and so the subscriber is taking the values which are published like a 20 seconds or 40 seconds ago, I want it to take the value in the time I making the expression

any clue ? where could be the problem

edit retag flag offensive close merge delete

Comments

2

How did you initialize the subscriber (especially which queue_size are you using?) And how long does your callback take to process a single message?

NEngelhard gravatar image NEngelhard  ( 2018-05-17 11:22:44 -0600 )edit

I used queue size of one for the publisher and nothing for the subscriber for how long does my callback take for a single process? it takes around 3 seconds something what I should do now what do you think ?

ShehabAldeen gravatar image ShehabAldeen  ( 2018-05-17 14:10:25 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2018-05-18 14:02:48 -0600

NEngelhard gravatar image

It looks like you are filling up your subscriber queue so that you are processing older and older messages. Could you try again with a queue_size of 1?

edit flag offensive delete link more

Comments

2

It was exactly the same as u said I made the queue_size for both the publisher and the subscriber equal to 1 and it worked perfectly

ShehabAldeen gravatar image ShehabAldeen  ( 2018-06-21 07:00:13 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2018-05-17 11:06:42 -0600

Seen: 2,757 times

Last updated: May 18 '18