MagicWinnie

Untitled

Nov 25th, 2021 (edited)
668
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. z = 1.5
  2. FIELD_LENGTH_X = 2.83 #in meters
  3. FIELD_LENGTH_Y = 2.65 #in meters
  4. deltaX = 0.65 #in meters
  5. deltaY = 0.25 #in meters
  6. points = []
  7.  
  8. i = 0.1
  9. count = 0
  10. # Создание массива с точками для дальнейшего полета по полю (полет по зиг-загу)
  11. while i <= FIELD_LENGTH_X:
  12.     j = 0.1
  13.     while j <= FIELD_LENGTH_Y:
  14.         if count % 2 == 0:
  15.             points.append((i, j))
  16.         else:
  17.             points.append((i, FIELD_LENGTH_Y - j))
  18.         j += deltaY
  19.     i += deltaX
  20.     count += 1
  21.  
  22. for point in points:
  23.     navigate_wait(x=point[0], y=point[1], z=z, speed=0.4, yaw=3.14/2.0)
  24.     rospy.sleep(0.3)
  25.     # ТУТ РАСПОЗНАВАНИЕ
  26.     rospy.sleep(0.3)
RAW Paste Data