duckietown / gym-duckietown

Self-driving car simulator for the Duckietown universe
http://duckietown.org
Other
51 stars 19 forks source link

Free camera mode #77

Closed abdelq closed 6 years ago

abdelq commented 6 years ago

Related to #21

I took a different approach. Instead of a separate script, it is an flag that can be toggled using SPACE. If the camera is in free mode, you can wander around with the arrows and rotate or adjust the pitch with W, A, S, D, E, Q. If you press SPACE again, the camera is mounted back to the point of view of the robot, and movement is back to normal.

Since the steps are now updated automatically, I didn't bother to separate the logic.

This PR also includes a fix for the flickering on PAGEUP due to the call to env.render() and uses the self.cam_height variable already in place instead of the constant, so that domain randomization can affect the camera height of the bot.

aerial_shot

maximecb commented 6 years ago

It's cool to see this map from a free camera view. It looks so different, even though I've looked at it many many times.

I would prefer to have a separate script for free camera mode, because it seems to me that it serves a different purpose, and I'm trying to keep these scripts as simple as possible, so that when people open them up and look, they are not confused.

abdelq commented 6 years ago

@maximecb Now resides in a separate script. I also removed the text label from the render in the free camera mode.