oljo I want to reset my counters at a certain time but how do I use clock.now()? I tried now=clock.now() now =getTimestamp(self) print(f"Current time: {now.hour}:{now.minute}:{now.second}") But none of them works. Anyone?
jakaskerl oljo Is this inside script node? Generally, dai.Clock.now() will return the timedelta from last PC bootup. .getTimestamp() will return the timedelta from last PC bootup to the moment at which a frame was captured. It does not have hour, minute, second properties. Thanks, Jaka
oljo Ok I understand. Is there a way to reset the counters at a specific time every day (midnight) gen2-people-tracker/api/script.py counter = {'up': 0, 'down': 0, 'left': 0, 'right': 0} # Y axis (up/down), X axis (left/right)
jakaskerl oljo You can reset it by sending a reset flag (buffer) from host PC to device at midnight (using Python's time or datetime modules) if you are in script node. Example: https://docs.luxonis.com/software/depthai/examples/script_json_communication/ Thanks, Jaka