How to read a topic last value from a Python script?
Hello.
I'm working on a teleop program in Python. I want to change a joint position and add an offset read from the keyboard.
So I need to read a topic value to add the offset and send the command with the target value. Of course I have read the tutorial about the subscriber in Python. My requirement is slightly different. I do not want to process a piece of code each time a value is published. I do not even need a fresh value, since I consider that the last published one is sufficient.
So is there a way to get this last published value using rospy?
Thanks for your help.