high-performance status checking
Each time I read and write from and to the servos in my symmetric robot, I want to check a mode that determines which servos to talk to (the frames of this robot can change while it's running). Because the reading and writing happens continuously through topics, I want to make sure this checking adds as little overhead as possible.
I considered two solutions: services and a parameter server. From what I understand, services seem to be able to do this quickly, but it looks like they can't deliver a different response, as when the mode changes. A Parameter Server can do the trick, but the wiki explicitly states that it's not meant for high-performance and dynamic data. Are there any other solutions or am I overestimating the overhead with the parameter server?
Are you able to structure the service file such that it only returns information in a single field (string, int32)? I.E. the service function is to return what mode a servo is in. Then the service client could track the mode of each servo over time, and detect changes.
So would this be what you mean?: Before reading and writing to the servos, you send a service request to a topic 'mode', which just returns a single field. When some file wants to change the mode, it publishes to that topic 'mode' to change it.
Yes thats the idea. You may want to make the 'mode change' type action a service also, depending on your application. Since services are blocking, sending a service call would ensure the servo is in the desired mode before additional reading/writing.
Ok, so (how) does the topic store the actual value of the mode? And how does the service call to change the mode affect it? By publishing to it once? Perhaps you could summarize and write this up so I can accept your answer. Thanks