Commit 1186226c authored by Barcis, Michal's avatar Barcis, Michal

adjusted parameters for GLOBECOM publication

parent fb310bf0
......@@ -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.25
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=15,
limit_history=10,
)
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
......
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment