def handle(req):
global msg, pub, task
print 'get resp class'
response_class = get_response_class(req)
print 'resp', response_class
try:
task = req
with task_change_lock:
pub, msg = get_message_publisher(task)
print pub, msg
msg.header.stamp = rospy.get_rostime()
pub.publish(msg)
if not offboard_and_arm():
return response_class(success=False, message='Cannot arm or offboard the vehicle')
return response_class(success=True)
except Exception as e:
return response_class(success=False, message=e.message)
评论列表
文章目录