Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inference
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
optima
inference
Commits
0d789b20
Commit
0d789b20
authored
4 years ago
by
Daalen, Tim van
Browse files
Options
Downloads
Patches
Plain Diff
diskspace check debug
parent
ab709f36
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
camera.py
+2
-1
2 additions, 1 deletion
camera.py
cfg/detection.yaml
+2
-2
2 additions, 2 deletions
cfg/detection.yaml
usb_Filestorage.py
+10
-9
10 additions, 9 deletions
usb_Filestorage.py
with
14 additions
and
12 deletions
camera.py
+
2
−
1
View file @
0d789b20
...
...
@@ -15,7 +15,8 @@ class take_img(Thread):
self
.
_running
=
True
self
.
save_IMGS
=
CONFIG
[
'
save-IMGS
'
]
self
.
save_GPS
=
CONFIG
[
'
save-GPS
'
]
self
.
usb
=
USB_class
()
self
.
usb
=
USB_class
(
CONFIG
[
'
save-every-x
'
])
# connecting to the first available camera
self
.
camera
=
pylon
.
InstantCamera
(
pylon
.
TlFactory
.
GetInstance
().
CreateFirstDevice
())
...
...
This diff is collapsed.
Click to expand it.
cfg/detection.yaml
+
2
−
2
View file @
0d789b20
...
...
@@ -15,8 +15,8 @@ logging: False
GPS
:
True
Camera
:
True
AGENSO
:
True
save-GPS
:
Fals
e
save-IMGS
:
Fals
e
save-GPS
:
Tru
e
save-IMGS
:
Tru
e
save-every-x
:
10
#dont save all imgs & GPS coordinates, its simply to much
#folders
...
...
This diff is collapsed.
Click to expand it.
usb_Filestorage.py
+
10
−
9
View file @
0d789b20
...
...
@@ -23,7 +23,8 @@ class USB_class:
self
.
UUID
=
None
#UUID of the disk
self
.
reconnect
()
self
.
free_USBGBs
=
self
.
check_free_diskspace
()
self
.
writenum
=
0
#counter to avoid checking diskspace for every call
self
.
writeIMg_cnt
=
0
#counter to avoid checking diskspace for every call
self
.
writeGPS_cnt
=
0
self
.
save_frequency
=
save_frequency
#need sudo rights for these folders...
...
...
@@ -153,15 +154,15 @@ class USB_class:
if
not
self
.
reconnect
():
return
file_dir
=
os
.
path
.
join
(
MOUNT_DIR
,
IMG_folder
,
subfolder
)
self
.
write
num
=
self
.
write
num
+
1
self
.
write
IMg_cnt
=
self
.
write
IMg_cnt
+
1
try
:
#avoid overflowing the disk, we save one/x files and check the diskspace every 50 files.
if
self
.
write
num
%
(
self
.
save_frequency
*
50
)
==
0
:
if
self
.
write
IMg_cnt
%
(
self
.
save_frequency
*
50
)
==
0
:
self
.
free_USBGBs
=
self
.
check_free_diskspace
()
self
.
write
num
=
0
self
.
write
IMg_cnt
=
0
if
self
.
free_USBGBs
<
0.1
:
return
elif
self
.
write
num
%
save_frequency
:
elif
self
.
write
IMg_cnt
%
self
.
save_frequency
==
0
:
#create subfolder if it not there yet & save image
if
not
self
.
check_direxists
(
file_dir
):
raise
Exception
(
"
disk not connected
"
)
...
...
@@ -179,15 +180,15 @@ class USB_class:
if
self
.
UUID
==
None
:
if
not
self
.
reconnect
():
return
self
.
write
num
=
self
.
write
num
+
1
self
.
write
GPS_cnt
=
self
.
write
GPS_cnt
+
1
try
:
#avoid overflowing the disk
if
self
.
write
num
%
(
self
.
save_frequency
*
50
)
==
0
:
if
self
.
write
GPS_cnt
%
(
self
.
save_frequency
*
50
)
==
0
:
self
.
free_USBGBs
=
self
.
check_free_diskspace
()
self
.
write
num
=
0
self
.
write
GPS_cnt
=
0
if
self
.
free_USBGBs
<
0.1
:
return
elif
self
.
write
num
%
save_frequency
:
elif
self
.
write
GPS_cnt
%
self
.
save_frequency
==
0
:
with
open
(
os
.
path
.
join
(
MOUNT_DIR
,
GPS_folder
,
(
filename
+
"
.txt
"
)),
"
a
"
)
as
file
:
file
.
write
(
data_string
)
except
Exception
as
e
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment