microsoft / AirSim

Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research
https://microsoft.github.io/AirSim/
Other
16.48k stars 4.59k forks source link

clockspeed seems doesn't work #4241

Closed ZhangFanSC closed 2 years ago

ZhangFanSC commented 2 years ago

Question

What's your question?

Clockspeed does not work.  For example, I set clockSpeed to 3, but the timestamp in the actual emulator is still not the scale of the real-world timestamp.  I would like to ask if this means clockSpeed has no effect.  It's just a visual acceleration, and it doesn't really help the training outcome, right?

Context details

UAR% ~XJW5$U0K_VVW7D~UX

(5Q011 WV7%$S{3B0A8$WDM

Include details of what you already did to find answers

How do I set up clockSpeed to work?@ahmed-elsaharti Thanks.

ahmed-elsaharti commented 2 years ago

Hi @ZhangFanSC , From what I'm seeing in the code https://github.com/microsoft/AirSim/blob/bb9922eb0d56877d8e987ec1c24acc13c4ab3730/Unreal/Plugins/AirSim/Source/Vehicles/Multirotor/MultirotorPawnSimApi.cpp#L85 it looks like the timestamp is independent of the simulated clock speed and basically reports back the time since epoch regardless of the simualtion's clock and/or if the sim is paused.

ZhangFanSC commented 2 years ago

So my idea is that if I set clockSpeed to 4, and I change the time interval between step execution in the corresponding reinforcement learning to 1/4 as before, will that work in the end? @ahmed-elsaharti Thanks.

ahmed-elsaharti commented 2 years ago

@ZhangFanSC if im understanding what you're saying correctly, doing this will result in a 'step execution' every '1 simulated second'. Since 1 real world second = 4 simulated seconds, A command executed every 1/4 real world second should result in a that command being executed every 1 'simulated second'.... i think xD

ZhangFanSC commented 2 years ago

ok,thank you.@ahmed-elsaharti

jonyMarino commented 2 years ago

This is related to #4232.

Thanks, @ahmed-elsaharti!! Good to see you again!

ahmed-elsaharti commented 2 years ago

Thanks @jonyMarino! I try to take a glance whenever possible 🤓

zimmy87 commented 2 years ago

Hi @ZhangFanSC, I've put out #4305 for fixing this behavior, please test with the PR applied and let me know if you have any issues

haotiangu commented 1 year ago

@zimmy87 Hi, I am trying to change the clock speed from 1 to 0.5 in setting file. Seems like the test output is still default clockspeed when running the test code posed by @jonyMarino . Could you guys please give me some ideas. The airsim is the latest version. UE IS 4.27.1. Ubuntu 18.04 haotian@haotian-911-SE-KN:~/AirSim/PythonClient/car$ python3 clockspeed.py Connected! Client Ver:1 (Min Req: 1), Server Ver:1 (Min Req: 1)

1697666955089885000 0.0 1.00804 1.001178 0.997832 1.006489 0.999038 1.001592 0.99849 ^CTraceback (most recent call last): File "clockspeed.py", line 23, in time.sleep(1.0) KeyboardInterrupt