Closed rondey closed 3 years ago
Hi, rondey. It is not a bug but a feature of MetaDrive. In the beginning of each episode, the simulation engine will clear and recycle all objects in the scene and place them into a buffer for next time use. In your case, vehicle = env.vehicle
indicates the vehicle
is the vehicle generating in the first episode, but after the reset()
is called, vehicle
will be removed from the scene and inactive. And the object which env.vehicle
represents in second episode changes to a new one. So you have to update your code to, for example,
speed=env.vehicle.speed,
to retrieve the current tracked vehicle information instead of
speed=vehicle.speed
Thank you! Problem solved!
Hello, I'm trying to get the data of the vehicle using this code:
This code shows on the screen the vehicle's data in real time and works in the first simulation. However when the second simulation starts, the data are no more updated. The vehicle speed data is updated but is completely wrong with the respect of the actual speed of the car.
On the other hand, in PGDrive using this code:
In the first and subsequent simulations the vehicle's data are correctly updated. What could be the problem?