Skip to content

Commit 02dfa0d

Browse files
committed
various minor changes
1 parent 5d91c5d commit 02dfa0d

19 files changed

+125
-18
lines changed
File renamed without changes.

CAM/__init__.py

Whitespace-only changes.

CAM/sample.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import time
33
import cv2
44
import os
5-
from Camera import CameraControl
5+
from CameraControl import CameraControl
66
from Undistort import Undistort
77

88
if __name__ == '__main__':
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
2021-05-11 10:45:00,005 DEBUG 1620722700.005104
2+
2021-05-11 10:45:00,044 DEBUG 1620722700.044
3+
2021-05-11 10:45:00,082 DEBUG 1620722700.082896
4+
2021-05-11 10:45:00,134 DEBUG 1620722700.134758
5+
2021-05-11 10:45:00,194 DEBUG 1620722700.194597
6+
2021-05-11 10:45:00,244 DEBUG 1620722700.244464
7+
2021-05-11 10:45:00,307 DEBUG 1620722700.307296
8+
2021-05-11 10:45:00,354 DEBUG 1620722700.35417
9+
2021-05-11 10:45:00,394 DEBUG 1620722700.394064
10+
2021-05-11 10:45:00,437 DEBUG 1620722700.437946
11+
2021-05-11 10:45:00,483 DEBUG 1620722700.483824
12+
2021-05-11 10:45:00,546 DEBUG 1620722700.546656
13+
2021-05-11 10:45:00,611 DEBUG 1620722700.611483
14+
2021-05-11 10:45:00,611 DEBUG Added 13
15+
2021-05-11 10:45:00,738 DEBUG 1620722700.738238
16+
2021-05-11 10:45:00,789 DEBUG 1620722700.789194
17+
2021-05-11 10:45:00,861 DEBUG 1620722700.861211
18+
2021-05-11 10:45:00,909 DEBUG 1620722700.909221
19+
2021-05-11 10:45:00,972 DEBUG 1620722700.972206
20+
2021-05-11 10:45:01,040 DEBUG 1620722701.040213
21+
2021-05-11 10:45:01,125 DEBUG 1620722701.125223
22+
2021-05-11 10:45:01,205 DEBUG 1620722701.205224
23+
2021-05-11 10:45:01,277 DEBUG 1620722701.277211
24+
2021-05-11 10:45:01,344 DEBUG 1620722701.344228
25+
2021-05-11 10:45:01,419 DEBUG 1620722701.419215
26+
2021-05-11 10:45:01,492 DEBUG 1620722701.492724
27+
2021-05-11 10:45:01,581 DEBUG 1620722701.581201
28+
2021-05-11 10:45:01,648 DEBUG 1620722701.648263
29+
2021-05-11 10:45:01,726 DEBUG 1620722701.726202
30+
2021-05-11 10:45:01,808 DEBUG 1620722701.808209
31+
2021-05-11 10:45:01,848 DEBUG 1620722701.84822
32+
2021-05-11 10:51:47,589 DEBUG 1620723107.58946
33+
2021-05-11 10:51:47,626 DEBUG 1620723107.625989
34+
2021-05-11 10:51:47,663 DEBUG 1620723107.663586
35+
2021-05-11 10:51:47,700 DEBUG 1620723107.700698
36+
2021-05-11 10:51:47,738 DEBUG 1620723107.738588
37+
2021-05-11 10:51:47,774 DEBUG 1620723107.774867
38+
2021-05-11 10:51:47,812 DEBUG 1620723107.812161
39+
2021-05-11 10:51:47,849 DEBUG 1620723107.849667
40+
2021-05-11 10:51:47,886 DEBUG 1620723107.886358
41+
2021-05-11 10:51:47,923 DEBUG 1620723107.923498
42+
2021-05-11 10:51:47,959 DEBUG 1620723107.959832
43+
2021-05-11 10:51:47,997 DEBUG 1620723107.99772
44+
2021-05-11 10:51:48,035 DEBUG 1620723108.035641
45+
2021-05-11 10:51:48,072 DEBUG 1620723108.072108
46+
2021-05-11 10:51:48,109 DEBUG 1620723108.108669
47+
2021-05-11 10:51:48,145 DEBUG 1620723108.14598
48+
2021-05-11 10:51:48,185 DEBUG 1620723108.185256
49+
2021-05-11 10:51:48,222 DEBUG 1620723108.222441
50+
2021-05-11 10:51:48,223 DEBUG Added 18
51+
2021-05-11 10:51:48,309 DEBUG 1620723108.30931
52+
2021-05-11 10:51:48,356 DEBUG 1620723108.356185
53+
2021-05-11 10:51:48,403 DEBUG 1620723108.40346
54+
2021-05-11 10:51:48,441 DEBUG 1620723108.441353
55+
2021-05-11 10:51:48,486 DEBUG 1620723108.48679
56+
2021-05-11 10:51:48,535 DEBUG 1620723108.535896
57+
2021-05-11 10:51:48,586 DEBUG 1620723108.586523
58+
2021-05-11 10:51:48,635 DEBUG 1620723108.634321
59+
2021-05-11 10:51:48,685 DEBUG 1620723108.685065
60+
2021-05-11 10:51:48,736 DEBUG 1620723108.736329
61+
2021-05-11 10:51:48,788 DEBUG 1620723108.788441
62+
2021-05-11 10:51:48,838 DEBUG 1620723108.83814
63+
2021-05-11 10:51:48,884 DEBUG 1620723108.884546
64+
2021-05-11 10:51:48,934 DEBUG 1620723108.934454
65+
2021-05-11 10:51:48,991 DEBUG 1620723108.991303
66+
2021-05-11 10:51:49,040 DEBUG 1620723109.040966
67+
2021-05-11 10:51:49,099 DEBUG 1620723109.099584
68+
2021-05-11 10:51:49,144 DEBUG 1620723109.144465
69+
2021-05-11 10:51:49,196 DEBUG 1620723109.19677
70+
2021-05-11 10:51:49,243 DEBUG 1620723109.243437
71+
2021-05-11 10:51:49,282 DEBUG 1620723109.282343

DET/README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ Before running any Python script make sure that you setup the OpenVINO environme
1111

1212
On Windows the followng command can be used:
1313

14-
```
14+
```sh
1515
"C:\Program Files (x86)\IntelSWTools\openvino\bin\setupvars.bat"
1616
```
1717

18+
On Linux the command is:
19+
```sh
20+
source /opt/intel/openvino_2021/bin/setupvars.sh
21+
```
22+
1823

1924
## Quick tutorial
2025

DET/__init__.py

Whitespace-only changes.

DET/detector.py

+19-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,25 @@
2424

2525
import cv2
2626
import numpy as np
27-
from openvino.inference_engine import IECore
27+
try:
28+
from openvino.inference_engine import IECore
29+
except ImportError as e:
30+
"""OpenVino is not initialized. Make sure it is installed and the environment variables are set.
31+
You can run the following command on Windows:
32+
```sh
33+
"C:\Program Files (x86)\IntelSWTools\openvino\bin\setupvars.bat"
34+
```
35+
36+
On Linux the command is:
37+
```sh
38+
source /opt/intel/openvino_*/bin/setupvars.sh
39+
```
40+
"""
41+
print( "ERROR: OpenVino is not initialized. Make sure it is installed and the environment variables are set \n \
42+
by running \"C:\\Program Files (x86)\\IntelSWTools\\openvino\\bin\\setupvars.bat\" on Windows or \n \
43+
\"source /opt/intel/openvino_*/bin/setupvars.sh\" on Unix" )
44+
print( "Traceback: " + str(e) ) # print traceback!
45+
2846

2947

3048
logging.basicConfig(format="[ %(levelname)s ] %(message)s", level=logging.INFO, stream=sys.stdout)

DRONE/Renderer_Detector_MultiProcess_Deferred.py renamed to DRONE/Renderer_Detector.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def __init__(self, CenterUTMInfo, ObjModelPath, ObjModelImagePath, basedatapath,
129129
self._device = device
130130
self._legacy_normalization = legacy_normalization
131131
self._PrePlannedPath = PrePlannedPath
132-
self._LowerThreshold =LowerThreshold
132+
self._LowerThreshold = LowerThreshold
133133
self._UpperThreshold = UpperThreshold
134134
self.CenterEast = CenterUTMInfo[0]
135135
self.CenterNorth = CenterUTMInfo[1]

DRONE/__init__.py

Whitespace-only changes.

DRONE/droneCommunication_SI_ZeroTol.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ typedef volatile signed char vs8;
6767

6868
//#define SERIAL "/dev/bus/usb/001/005" /*<- this needs to be updated*/
6969
//#define SERIAL "/dev/ttyAMA0" /*<- default from student!*/
70-
#define SERIAL "/dev/ttyUSB0" /* <- this should be correct in Linux (talked to Stefan about it)! */
70+
#define SERIAL "/dev/ttyUSB0" /* <- this should be correct in Linux (e.g. Raspberry Pi)! */
7171

7272
typedef struct
7373
{

DRONE/main.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
importlib.reload(naos_det) # this makes sure that changes in naos_det.py have an effect
2121
import datetime
2222
import multiprocessing
23-
from Planner_Indrajit import Planner
24-
from FlyingControl_MultiProcess import DroneFlyingControl
25-
from Drone_Communication_MultiProcess import DroneCommunication, ReadGPSReceivedLogFiles, ReadNewGPSReceivedLogFiles
26-
from Renderer_Detector_MultiProcess_Deferred import Renderer
27-
from CameraControl_MultiProcess import CameraControl
28-
from LFR_utils import hdr_mean_adjust
29-
from PathVisualizer import Visualizer
23+
from ..PLAN.Planner import Planner
24+
from ..DRONE.FlyingControl import DroneFlyingControl
25+
from ..DRONE.DroneCom import DroneCommunication, ReadGPSReceivedLogFiles, ReadNewGPSReceivedLogFiles
26+
from ..DRONE.Renderer_Detector import Renderer
27+
from ..CAM.CameraControl import CameraControl
28+
from ..LFR.python.LFR_utils import hdr_mean_adjust
29+
from ..PLAN.PathVisualizer import Visualizer
3030
from scipy.stats import circmean
3131
import random
3232
from scipy import interpolate
@@ -35,7 +35,6 @@
3535

3636
#New Changes to send Email
3737
import email, smtplib, ssl
38-
3938
from email import encoders
4039
from email.mime.base import MIMEBase
4140
from email.mime.multipart import MIMEMultipart
@@ -194,7 +193,7 @@ def __init__(self, sitename, area_sides, ReadfromFile = False, DroneAttached =
194193
# 'Speed': # x 10
195194
# 'Index':
196195
# }
197-
CurrentGPSInfoQueueEventQueue = multiprocessing.Queue(maxsize=20)
196+
# CurrentGPSInfoQueueEventQueue = multiprocessing.Queue(maxsize=20)
198197
RenderingQueue = multiprocessing.Queue(maxsize=200)
199198
FrameQueue = multiprocessing.Queue(maxsize=200) # dictionary of the form { 'Frames': [img1, img2, ...] 'FrameTimes': [time1, time2, ...] }
200199

LFR/__init__.py

Whitespace-only changes.

LFR/python/LFR_utils.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@
55
from PIL import Image # needed to load hdr images
66
import math
77
import os
8+
from pathlib import Path
89
import glm
910
import sys
1011

11-
def init_window( aos_python_path = 'LFR/python' ):
12+
13+
def init_window( aos_python_path = Path(__file__).resolve().parent ):
1214

1315
sys.path.insert(1,aos_python_path )
1416
import pyaos
1517

1618
window = pyaos.PyGlfwWindow(512,512,'AOS') # make sure there is an OpenGL context
1719
return window
1820

19-
def init_aos(fov = 50.815436217896945, aos_python_path = 'LFR/python' ):
21+
def init_aos(fov = 50.815436217896945, aos_python_path = Path(__file__).resolve().parent ):
2022

2123
try:
2224
import pyaos

LFR/python/__init__.py

Whitespace-only changes.
58 Bytes
Binary file not shown.

LFR/python/pyaos_test.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import glm
77
import numpy as np
88
import numpy.testing
9+
from pathlib import Path
910

1011

1112
class TestAOSRenderTwice(unittest.TestCase):
@@ -216,4 +217,14 @@ def test_shaderloading(self):
216217

217218

218219
if __name__ == '__main__':
219-
unittest.main()
220+
221+
file = Path(__file__).resolve()
222+
parent, root = file.parent, file.parents[1]
223+
224+
wd = os.getcwd()
225+
os.chdir(parent) # change to AOS working dir for startup (this is required so that the program finds dlls and the shader)
226+
227+
228+
unittest.main()
229+
230+
os.chdir(wd) # change back to previous working directory

PLAN/__init__.py

Whitespace-only changes.

__init__.py

Whitespace-only changes.

requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ opencv-python
33
numpy
44
cython
55
utm
6-
matplotlib
6+
matplotlib
7+
scipy

0 commit comments

Comments
 (0)