Advertisement
Guest User

Untitled

a guest
Jun 14th, 2021
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. # global variable:
  2. timestamp_cycles = 0
  3.  
  4.  
  5.  
  6. # per message:
  7.  
  8.  
  9.         # get 32-bit timestamp (in cycles) from message and unwrap it:
  10.         timestamp_cycles += ( msg.timestamp - timestamp_cycles ) & 0xffffffff
  11.  
  12.         # convert to timestamp in seconds:
  13.         timestamp = timestamp_cycles / 200e6
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement