added timestamp to target_velocity.py
This commit is contained in:
parent
89db75f868
commit
6f27401882
@ -1,3 +1,4 @@
|
||||
import datetime
|
||||
import pickle
|
||||
import sys
|
||||
from random import randrange
|
||||
@ -69,7 +70,8 @@ class Orchestrator:
|
||||
target_vel = randrange(0, 130)
|
||||
print('Target velocity: {}'.format(target_vel))
|
||||
response_channel.send(pickle.dumps(
|
||||
TargetVelocity(vin=received_daf_object.vehicle_identification_number, target_velocity=target_vel)))
|
||||
TargetVelocity(vin=received_daf_object.vehicle_identification_number, target_velocity=target_vel,
|
||||
timestamp=datetime.datetime.now())))
|
||||
|
||||
def handle_tl_state_receive(self, msg):
|
||||
"""
|
||||
|
||||
@ -1,10 +1,15 @@
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
@dataclass
|
||||
class TargetVelocity:
|
||||
vin: str
|
||||
target_velocity: float
|
||||
timestamp: datetime
|
||||
|
||||
def to_dict(self):
|
||||
return self.__dict__
|
||||
return {'vin': self.vin,
|
||||
'target_velocity': self.target_velocity,
|
||||
'timestamp': self.timestamp.timestamp()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user