objects_server.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:ros-interop 作者: mcgill-robotics 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号