I am using the following settings:
timeSettings = world.get_settings()
timeSettings.synchronous_mode = True
timeSettings.fixed_delta_seconds = 0.1
Output of following is 0.1 and I am saving images at that rate.
deltaSeconds = world.get_snapshot().timestamp.delta_seconds
But I want to send data through serial and this is related to OS time. I am calculating OS time to process like this:
beforeOsTimestamp = world.get_snapshot().timestamp.platform_timestamp
print(“BEFORE Time register of the frame at which this measurement was taken”, beforeOsTimestamp)world.tick()
afterOsTimestamp = world.get_snapshot().timestamp.platform_timestamp
print(“AFTER Time register of the frame at which this measurement was taken”, afterOsTmestamp)
print(“Os timestamp diff:ms”,(afterOsTimestamp-beforeOsTimestamp)*1000)
The OS time difference varies from 35 ms to 120 ms. How Do I get a fix OS timestamp (10 Hz or 0.1 s) to send data through serial at that rate?