Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Quoting rospy documentation,

rospy.on_shutdown(h)

Register handler to be called when rospy process begins shutdown. h is a function that takes no arguments. You can request a callback using rospy.on_shutdown() when your node is about to begin shutdown. This will be invoked before actual shutdown occurs, so you can perform service and parameter server calls safely. Messages are not guaranteed to be published.

Isn't your callback method expecting 3 arguments (self, position and time)? But the function h takes no arguments (argument self is provided).

When the callback is called, the TypeError is thrown because the callback method is called is called with insufficient number of arguments. And I'm not sure you need those two arguments because you don't use them inside the method anyway.

Inside the Trajectory class, check the stop() definition to this :

def stop (self):
        self._client.cancel_goal()

It will solve the problem.

Quoting rospy documentation,

rospy.on_shutdown(h)

Register handler to be called when rospy process begins shutdown. h is a function that takes no arguments. You can request a callback using rospy.on_shutdown() when your node is about to begin shutdown. This will be invoked before actual shutdown occurs, so you can perform service and parameter server calls safely. Messages are not guaranteed to be published.

Isn't your callback method expecting 3 arguments (self, position and time)? position, time)? But the function h method h() takes no arguments (argument self self is provided).

When the callback is called, the TypeError is thrown because the callback method is called is called with insufficient number of arguments. And I'm not sure you need those two arguments because you don't use them inside the method anyway.

Inside the Trajectory class, check the stop() definition to this :

def stop (self):
        self._client.cancel_goal()

It will solve the problem.