Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket
- import struct
- import math
- import time
- import random
- UDP_IP = "127.0.0.1"
- UDP_PORT = 4123
- sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- def sd(m):
- sock.sendto(m, (UDP_IP, UDP_PORT))
- t=0
- wx=0
- wy=0
- wz=0
- h=0
- p=0
- r=0
- ax=0
- ay=0
- az=0
- vx=0
- vy=0
- vz=0
- x=0
- y=0
- z=0
- idd=0
- random.seed()
- while True:
- time.sleep(0.2)
- # t=1
- # wx=random.random()
- # wy=random.random()
- # wz=random.random()
- # h=random.random()
- h=4.276208376215706*3.1415926/180
- # h=1
- # p=random.random()
- # r=random.random()
- # ax=random.random()
- # ay=random.random()
- # az=random.random()
- # vx=random.random()
- # vy=random.random()
- # vz=random.random()
- # x=random.randint(100,40000000)
- # y=random.randint(100,40000000)
- # z=random.randint(100,40000000)
- # idd=1
- data=struct.pack('Iffffffffffffiiii', t, wx, wy, wz, h, p, r, ax, ay, az, vx, vy, vz, x, y, z, idd)
- sd(data)
- print(h*180/3.1415926)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement