Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In your definition of the RobotControl class, you never update self.force. It's set in your __init__ method, but it never changes. You'll need to update it somehow, either in your callback or somewhere else.

For the TypeError, you're explicitly calling your callback function and you're not passing it any parameters. First, you don't explicitly call a callback function. The callback function will be called when a message is received on the topic that your subscriber subscribes to receives a message. Second, if you were to actually call it you'd need to pass the data parameter. But you don't need to call it so remove the

r.callback()

line.