SHARE
TWEET

Untitled

a guest Aug 14th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def Collision_checker(messages_grouped):
  2. """
  3. messages_grouped as example:{Drone0: (list of dictionaries), Drone1: (list of dictionaries), ...}
  4. """
  5. for key in messages_grouped:
  6.      X_new=messages_grouped[key][1]['X (ENU)']
  7.      Y_new=messages_grouped[key][1]['Y (ENU)']
  8.      Z_new=messages_grouped[key][1]['altitude']
  9.      X_old=messages_grouped[key][0]['X (ENU)']
  10.      Y_old=messages_grouped[key][0]['Y (ENU)']
  11.      Z_old=messages_grouped[key][0]['altitude']
  12.      for key in messages_grouped:
  13.          X2_new=messages_grouped[key][1]['X (ENU)']
  14.          Y2_new=messages_grouped[key][1]['Y (ENU)']
  15.          Z2_new=messages_grouped[key][1]['altitude']
  16.          X2_old=messages_grouped[key][0]['X (ENU)']
  17.          Y2_old=messages_grouped[key][0]['Y (ENU)']
  18.          Z2_old=messages_grouped[key][0]['altitude']
  19.          Line1=Line_analysis(X_new,Y_new,Z_new, X_old, Y_old, Z_old)
  20.          Line2=Line_analysis(X2_new,Y2_new,Z2_new, X2_old, Y2_old, Z2_old)
  21.  
  22.          if Line1 is not None and Line2 is not None:
  23.              Intersection=Line1.intersection(Line2)
  24.          else:
  25.              pass
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top