From fc3e98bdc6a4c41cc07bded4544a1fce49bd11ae Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Mon, 19 Feb 2018 22:26:49 +0300 Subject: [PATCH] Updates docs/snippets.md Auto commit by GitBook Editor --- docs/snippets.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/snippets.md b/docs/snippets.md index 0964010d..1eb7a09f 100644 --- a/docs/snippets.md +++ b/docs/snippets.md @@ -16,18 +16,19 @@ def get_distance(x1, y1, z1, x2, y2, z2): Взлет и ожидание окончания взлета: ```python +z = 2 # высота tolerance = 0.2 # точность проверки высоты (м) # Запоминаем изначальную точку start = get_telemetry() # Взлетаем на 2 м -print navigate(z=2, speed=0.5, frame_id='fcu_horiz', auto_arm=True) +print navigate(z=z, speed=0.5, frame_id='fcu_horiz', auto_arm=True) # Ожидаем взлета while True: # Проверяем текущую высоту - if get_telemetry().z - start.z < tolerance: + if get_telemetry().z - start.z + z < tolerance: # Взлет завершен break rospy.sleep(0.2)