-
Notifications
You must be signed in to change notification settings - Fork 8.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix jerky camera angle in car racing env #2525
Conversation
Please wait a little before merging, there might be two additional fixes to include. I will try to detail them tomorrow, but in short:
|
In fact, the bug seems to come from the completion of a lap wrongly detected. See below: car_racing.mp4 |
No worries, we will wait a bit before merging because we want to migrate to pygame from pyglet as well alongside the version bump (context in #2099). I won't have time to get around to do that before I go on vacation for the rest of the year, so there's no rush on my side. |
I found the issue, unfortunately, it is not clear what to do...
|
It seems to me like #2 is the most natural. Is there any big issue with this approach that I'm not seeing? We'd obviously need to try learning with the changes before merging to ensure no unexpected behaviors occur given though. |
I don't have any strong opinions on the functionality, but I'd like to see some comments in the code explaining what's going on in lines 391-394 since it's a pretty unusual pattern. Can this be simplified/made more pythonic? Also, couldn't this operation be performed once per initialization or once per reset, and the coordinates of the tile can then be cached? |
sorry, I've got notifications off on gym, I implemented the fixes in my fork: For detecting the first tile, you should probably use the idx of the tile instead (see my fork where I set an id for each tile). I think we should provide an argument to choose how much should be visited to consider the lap over. |
@araffin are you happy with carlos' changes? |
and self.env.tile_visited_count / len(self.env.track) | ||
> self.lap_complete_percent | ||
): | ||
self.env_new_lap = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized this should be self.env.new_lap
no?
and in that case, termination is due to reaching lap end (should not be treated as normal termination)
Would you want to make a PR for this? |
well, current implementation is buggy, so I would say yes ;). We also need to fix |
Fixes #2099
You can find context and investigations in the issue.