I'm trying to create some sort of base_controller for my motors in C++. I have two question about topics that I cannot answer for now.
First, if I read a message on the cmd_vel topic for example using a subscriber does the message I just read "disappeared" from the topic. Meaning if another Node try to read it, is the previously read message "gone" ?
Second, depending on the answer to the first question, how can I know if their is a steady stream of command coming from the cmd_vel topic ? Meaning if the message is erased when I read it how can I know that it was not 'outdated" or when to stop ?
If it is not erase by reading but rather by if their more new information, how can two node send data on the same topic ?
To try to be clearer here is a situation example :
Let's say I publish a Twist for my robot to go forward on the cmd_vel for 3 second and I publish no stop Twist after those 3 seconds.
- What is my subscriber to this topic going to read during the 3 first second and after ?
- Same question but what if my subscriber is a little bit slow and start reading 1 second after I start publishing the twists ?
Thanks a lot.
↧