You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we found that python actionlib.SimpleActionServer will block to exit program, when we raise an exception. the following codes will reproduce the problem.
importrospyimportactionlibfromactionlib.msgimportTestActionfromactionlib.msgimportTestActionResultclasstest_t( object ):
defprocedure( self ):
#rospy.signal_shutdown('signal shutdown') # uncomment to exit programraiserospy.ROSException('exit program') # raise an exception for testdefgoal_callback( self ):
self.goal=self.as_tline.accept_new_goal()
defpreempt_callback( self ):
res=TestActionResult()
res.result.result=-1def__init__( self ):
self.goal=Noneself.action_server=actionlib.SimpleActionServer( 'test_action', TestAction, auto_start=False )
self.action_server.register_goal_callback ( self.goal_callback )
self.action_server.register_preempt_callback( self.preempt_callback )
#self.action_server.start() # if we did not start ActionServer, program will exit properly.if__name__=='__main__':
try:
rospy.init_node( 'testnode' )
test=test_t()
test.procedure()
exceptrospy.ROSExceptionase:
print( e )
print( 'terminated' ) # we can see this message, but program will never exit.
we can see 'terminated' message on the console, but the program is still running.
only kill -9 PID can stop the program.
to exit this program properly, we need rospy.signal_shutdown() before raising an exception, or do not to start SimpleActionServer by self.action_server.start().
we feel that actionlib.ActionServer.status_timer cannot stop, because that actionlib.ActionServer has no __del__ method to join the thread of the status_timer (in spite of that, actionlib.SimpleActionServer has __del__).
specifications of our development environment:
Debian Strech
ROS Melodic
Actionlib 1.11.13-0stretch.20190606.072225
we hope that it could be help.
The text was updated successfully, but these errors were encountered:
Dear developers,
we found that python actionlib.SimpleActionServer will block to exit program, when we raise an exception. the following codes will reproduce the problem.
we can see 'terminated' message on the console, but the program is still running.
only
kill -9 PID
can stop the program.to exit this program properly, we need
rospy.signal_shutdown()
before raising an exception, or do not to start SimpleActionServer byself.action_server.start()
.we feel that
actionlib.ActionServer.status_timer
cannot stop, because that actionlib.ActionServer has no__del__
method to join the thread of the status_timer (in spite of that, actionlib.SimpleActionServer has__del__
).specifications of our development environment:
we hope that it could be help.
The text was updated successfully, but these errors were encountered: