-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest_FlyView.py
More file actions
38 lines (30 loc) · 961 Bytes
/
test_FlyView.py
File metadata and controls
38 lines (30 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/python
import numpy as np
#import matplotlib.pyplot as plt
#from mpl_toolkits.mplot3d import Axes3D
import pyFlight as flight
import time
work_dir = "/home/prokop/git/SimpleSimulationEngine/cpp/Build/apps/AeroCombat"
flight.loadFromFile( work_dir+"/data/AeroCraftMainWing1.ini" )
fview = flight.FlightView( work_dir )
flight.setPose( np.array([0.0,200.0,0.0]), np.array([0.0,0.0,100.0]) , np.array([[1.0,0.0,0.0],[0.0,1.0,0.0],[0.0,0.0,1.0]]) )
flight.setTilt( 2, 0.02 )
#flight.setTilt( 0, 0.1 )
#flight.setTilt( 1, -0.1 )
#flight.setTilt( 3, 0.1 )
targets = np.random.random((30,4));
targets[:,:3] += -0.5;
targets[:, 0] *= 1000;
targets[:, 1] *= 200;
targets[:, 2] *= 1000;
targets[:, 3] += 2.0
#print targets
flight.setTargets( targets )
n = 10
poss=np.zeros((n,3 ))
vels=np.zeros((n,3 ))
rots=np.zeros((n,3,3))
for i in range(100000):
flight.fly( poss, vels, rots, nsub=10, dt=0.001 )
fview .draw()
time.sleep( 0.05)