From 0f0deb85da588d6c24001b1ea8cc4b4413353c3c Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Fri, 31 Jan 2020 19:50:27 +0300 Subject: [PATCH] docs: fix blocking takeoff snippet --- docs/en/snippets.md | 4 ++-- docs/ru/snippets.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/en/snippets.md b/docs/en/snippets.md index 3ac36f59..cd5e0fcc 100644 --- a/docs/en/snippets.md +++ b/docs/en/snippets.md @@ -39,7 +39,7 @@ print navigate(z=z, speed=0.5, frame_id='body', auto_arm=True) # Waiting for takeoff while not rospy.is_shutdown(): # Checking current altitude - if get_telemetry().z - start.z + z < tolerance: + if start.z + z - get_telemetry().z < tolerance: # Takeoff complete break rospy.sleep(0.2) @@ -53,7 +53,7 @@ def takeoff_wait(alt, speed=0.5, tolerance=0.2): print navigate(z=alt, speed=speed, frame_id='body', auto_arm=True) while not rospy.is_shutdown(): - if get_telemetry().z - start.z + z < tolerance: + if start.z + alt - get_telemetry().z < tolerance: break rospy.sleep(0.2) diff --git a/docs/ru/snippets.md b/docs/ru/snippets.md index 3ce65faa..0066d27d 100644 --- a/docs/ru/snippets.md +++ b/docs/ru/snippets.md @@ -56,7 +56,7 @@ print navigate(z=z, speed=0.5, frame_id='body', auto_arm=True) # Ожидаем взлета while not rospy.is_shutdown(): # Проверяем текущую высоту - if get_telemetry().z - start.z + z < tolerance: + if start.z + z - get_telemetry().z < tolerance: # Взлет завершен break rospy.sleep(0.2) @@ -70,7 +70,7 @@ def takeoff_wait(alt, speed=0.5, tolerance=0.2): print navigate(z=alt, speed=speed, frame_id='body', auto_arm=True) while not rospy.is_shutdown(): - if get_telemetry().z - start.z + z < tolerance: + if start.z + alt - get_telemetry().z < tolerance: break rospy.sleep(0.2)