scenario_runner
scenario_runner copied to clipboard
`GameTime.get_wallclocktime()` should return a `datetime` object
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