Ask Your Question
0

On the second argument of ros::NodeHandle::serviceClient

asked 2013-12-08 16:21:35 -0500

moyashi gravatar image

When do you use ros::NodeHandle::serviceClient with the second argument "persistent" set to "false" ?

I think that when "persistent" is set to "true", ros service performs better(faster) because there is no disconnection and reconnection between server and client. So basically, I use ros service client with "persistent == true".

However, this parameter's default value is "false". I wonder that "persistent == false" performs better in some cases. What kind of case is it ?

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-09-28 01:18:29 -0500

gvdhoorn gravatar image

However, this parameter's default value is "false". I wonder that "persistent == false" performs better in some cases. What kind of case is it ?

This is actually pretty well described on wiki/roscpp/Overview/Services - Persistent Connections:

ROS also allows for persistent connections to services. With a persistent connection, a client stays connected to a service. Otherwise, a client normally does a lookup and reconnects to a service each time. This potentially allows for a client to connect to a different node each time it does a service call, assuming the lookup returns a different node.

Persistent connections should be used carefully. They greatly improve performance for repeated requests, but they also make your client more fragile to service failures. Clients using persistent connections should implement their own reconnection logic in the event that the persistent connection fails.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-12-08 16:21:35 -0500

Seen: 271 times

Last updated: Sep 28 '16