def delete_object(self, req):
"""Handles DeleteObject service requests.
Args:
req: DeleteObjectRequest message.
Returns:
DeleteObjectResponse.
"""
response = interop.srv.DeleteObjectResponse()
try:
self.objects_dir.delete_object(req.id)
except (KeyError, OSError) as e:
rospy.logerr("Could not delete object: {}".format(e))
response.success = False
except Exception as e:
rospy.logfatal(e)
response.success = False
else:
response.success = True
return response
评论列表
文章目录