scenario_runner icon indicating copy to clipboard operation
scenario_runner copied to clipboard

`GameTime.get_wallclocktime()` should return a `datetime` object

Open Daraan opened this issue 1 year ago • 0 comments

Description

When using self.wallclock_t0 = GameTime.get_wallclocktime(), which returns _platform_timestamp a type-checker complains that the type used afterwards is int | datetime.datetime, however it is never used as int this is just the intial value. This minimal PR unifies the type to be always a datetime object.

- _platform_timestamp = 0
+ _platform_timestamp = datetime.datetime.fromtimestamp(0)

Where has this been tested?

  • Platform(s): Ubuntu 22.04
  • Python version(s): 3.7 & 3.10
  • Unreal Engine version(s):
  • CARLA version: 0.9.15 dev

Possible Drawbacks


This change is Reviewable

Daraan avatar Aug 27 '24 16:08 Daraan