Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AAU NAV
development
camera_streaming
Commits
1186226c
Commit
1186226c
authored
Jun 02, 2020
by
Barcis, Michal
Browse files
adjusted parameters for GLOBECOM publication
parent
fb310bf0
Changes
2
Hide whitespace changes
Inline
Side-by-side
camera_streaming/camera_stream.py
View file @
1186226c
...
...
@@ -66,7 +66,7 @@ class CameraStream(Node, MissionExecutor):
qos_profile
=
CUSTOM_QOS
,
# qos_profile=QoSPresetProfiles.get_from_short_key('SYSTEM_DEFAULT')
)
self
.
timer_period
=
0.
2
5
self
.
timer_period
=
0.5
self
.
timer
=
None
self
.
offset
=
self
.
timer_period
/
8
*
int
(
self
.
hosts
[
self
.
hostname
])
self
.
t_start
=
datetime
.
now
().
timestamp
()
...
...
@@ -135,7 +135,8 @@ class CameraStream(Node, MissionExecutor):
def
start_mission_at_timestamp
(
self
,
timestamp
):
super
().
start_mission_at_timestamp
(
timestamp
+
timedelta
(
seconds
=
20
*
self
.
timer_period
*
int
(
self
.
hosts
[
self
.
hostname
])
seconds
=
1
*
self
.
timer_period
*
int
(
self
.
hosts
[
self
.
hostname
])
+
self
.
offset
)
)
self
.
t_start
=
timestamp
.
timestamp
()
...
...
@@ -145,13 +146,18 @@ class CameraStream(Node, MissionExecutor):
self
.
t_end
=
timestamp
.
timestamp
()
-
self
.
t_start
self
.
constraints
=
{
'RATE'
:
simplesim
.
create_rate_constraint_violations
(
timeslot_length
=
1.
,
delta
=
0.6
,
),
'TPUT'
:
simplesim
.
create_throughput_constraint_violations
(
throughput
=
10.05
,
timeslot_length
=
1.
,
timeslot_length
=
0.5
,
delta
=
0.5
,
alpha
=
12
,
eta0
=
0.0001
,
# -20
coef_init
=
[[
1.37
]],
scale
=
1
,
# 4
pessymistic_latency
=
2.5
,
),
# 'TPUT': simplesim.create_throughput_constraint_violations(
# throughput=50.05,
# timeslot_length=0.3,
# ),
}
self
.
agent
=
EstimatingAgent
(
...
...
@@ -166,10 +172,10 @@ class CameraStream(Node, MissionExecutor):
now_func
=
lambda
:
time
.
time
()
-
self
.
t_start
,
agents
=
{
'base_station'
:
lambda
t
:
set
()},
future_messages_num
=
10
,
window_size
=
0.
1
,
window_size
=
0.
5
,
simulations_num
=
200
,
constraints
=
self
.
constraints
,
limit_history
=
1
5
,
limit_history
=
1
0
,
)
def
camera_received_callback
(
self
,
msg_metadata
):
...
...
@@ -189,9 +195,8 @@ class CameraStream(Node, MissionExecutor):
self
.
agent
.
received
(
native_message
)
def
start_mission
(
self
,
timestamp
):
self
.
get_logger
().
info
(
'Mission started'
)
time
.
sleep
(
self
.
offset
)
self
.
timer
=
self
.
create_timer
(
self
.
timer_period
,
self
.
timer_callback
)
self
.
get_logger
().
info
(
'Mission started'
)
# self.movement = threading.Thread(
# target=self.move
# )
...
...
@@ -221,10 +226,9 @@ class CameraStream(Node, MissionExecutor):
self
.
timer_period
=
1
/
float
(
params
.
get
(
'fps'
,
2
))
def
timer_callback
(
self
):
print
(
"TIMER CALLBACK"
,
datetime
.
now
().
timestamp
())
if
abs
(
(
datetime
.
now
().
timestamp
()
-
self
.
t_start
-
0.01
)
%
self
.
timer_period
-
self
.
offset
(
datetime
.
now
().
timestamp
()
-
self
.
t_start
+
0.01
-
self
.
offset
)
%
self
.
timer_period
)
>
0.02
:
print
(
"WARN: timer callback called out of sync, skipping"
)
return
...
...
camera_streaming/utility.py
View file @
1186226c
...
...
@@ -96,6 +96,7 @@ class UtilityVideo(Utility):
t_l
=
t_rcv
+
0.33
red
=
m
.
data
.
red
red
=
0.9
log_part
=
0
if
t_end
<
t_s
or
t_start
>
t_l
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment