def _arm(self):
print(self.namespace, 'arming')
service_name = '%s/mavros/cmd/arming' % self.namespace
rospy.wait_for_service(service_name)
try:
service = rospy.ServiceProxy(service_name, CommandBool)
resp = service(True)
except rospy.ServiceException as e:
print(self.namespace, 'service call to arm failed:', str(e),
file=sys.stderr)
return False
if not resp.success:
print(self.namespace, 'failed to arm', file=sys.stderr)
return False
print(self.namespace, 'armed')
return True
评论列表
文章目录