Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Simple action server and client not working as expected

Hi!

I am currently looking into the ROS actions and using the beginners tutorials (server and client). I've also read the detailed description article handling the way things work behind the scene.

However I am experiencing some strange behaviour on the side of my client and server. From my understanding (even outside ROS) the way a client and server are supposed to work is as follows:

  1. A server is started and runs until terminated expecting requests from one or multiple clients
  2. A client is started, connects to the action server and sets a goal that the server needs to fulfill
  3. The server processes the request and does its thing returning a result (here failure to execute the task is also viewed as a possible outcome)
  4. The client accepts the result
  5. And so on...

After building the Fibonacci client and server I did exactly that and expected what I have described in 3 and 4. However following issues occurred:

  • Client doesn't always register the presence of the server even after the server has been started after the client
  • Client NEVER registers the presence of the server if the server has been started before the client. The client waits infinitely (due to the waitForServer() in its code).
  • If the client has registered the presence of the server (usually it takes multiple tries :-/) and has sent a goal it returns Action did not finish before the time out. even though the job is pretty small and the server executes it in like no time (I also increased the wait delay of the client).

Also I can get the feedback from the server and even the result (but only while the client is still running). If I start/stop the client too fast I get

[ WARN] [1439476747.666795863]: goalConnectCallback: Trying to add [/fibonacci] to goalSubscribers, but it is already in the goalSubscribers list
[ WARN] [1439476747.767724663]: cancelConnectCallback: Trying to add [/fibonacci] to cancelSubscribers, but it is already in the cancelSubscribers list

Now I'm probably missing something but the way I have to fight my way through till both the server and client are responding appropriately is very strange and it also goes against my understanding of the client/server concept (with that I mean the fact I have to start my server after my client in order for the client to "see" the server).

Any idea what I'm doing wrong here? I even cloned the git repo for this tutorial yet the result is literally 100% the same.

Thanks!

Simple action server and client not working as expected

Hi!

I am currently looking into the ROS actions and using the beginners tutorials (server and client). I've also read the detailed description article handling the way things work behind the scene.

However I am experiencing some strange behaviour on the side of my client and server. From my understanding (even outside ROS) the way a client and server are supposed to work is as follows:

  1. A server is started and runs until terminated expecting requests from one or multiple clients
  2. A client is started, connects to the action server and sets a goal that the server needs to fulfill
  3. The server processes the request and does its thing returning a result (here failure to execute the task is also viewed as a possible outcome)
  4. The client accepts the result
  5. And so on...

After building the Fibonacci client and server I did exactly that and expected what I have described in 3 and 4. However following issues occurred:

  • Client doesn't always register the presence of the server even after the server has been started after the client
  • Client NEVER registers the presence of the server if the server has been started before the client. The client waits infinitely (due to the waitForServer() in its code).
  • If the client has registered the presence of the server (usually it takes multiple tries :-/) and has sent a goal it returns Action did not finish before the time out. even though the job is pretty small and the server executes it in like no time (I also increased the wait delay of the client).

Also I can get the feedback from the server and even the result (but only while the client is still running). If I start/stop the client too fast I get

[ WARN] [1439476747.666795863]: goalConnectCallback: Trying to add [/fibonacci] to goalSubscribers, but it is already in the goalSubscribers list
[ WARN] [1439476747.767724663]: cancelConnectCallback: Trying to add [/fibonacci] to cancelSubscribers, but it is already in the cancelSubscribers list

Now I'm probably missing something but the way I have to fight my way through till both the server and client are responding appropriately is very strange and it also goes against my understanding of the client/server concept (with that I mean the fact I have to start my server after my client in order for the client to "see" the server).

Any idea what I'm doing wrong here? I even cloned the git repo for this tutorial yet the result is literally 100% the same.

Thanks!