Skip to content
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

Introducing Dynamic Obstacles to the Empty Environment #50

Closed
Suman7495 opened this issue Feb 20, 2019 · 5 comments
Closed

Introducing Dynamic Obstacles to the Empty Environment #50

Suman7495 opened this issue Feb 20, 2019 · 5 comments

Comments

@Suman7495
Copy link
Contributor

Suman7495 commented Feb 20, 2019

Hi,

I want to introduce Dynamic Obstacles to the Empty Environment (MiniGrid-Empty). This could be represented by a moving colored square on the grid. The objective of the robot would be to navigate without colliding with these dynamic obstacles.

Moreover, I also want to introduce occlusion. If an obstacle lies in front of the robot, and another obstacle lies directly behind the first obstacle, the second obstacle should be hidden by the first one, i.e. the robot fails to see the 2nd obstacle.

The final environment will be similar to the Lava Crossing Environment with the following changes:

  1. Each obstacles (lava) is only 1 cell size.
  2. Motion of obstacle is random.
  3. Obstacle occlusion.

To achieve these tasks, could you kindly point me to the files to be modified?

Thank you

@maximecb
Copy link
Contributor

Hi Suman,

The empty environment is implemented here: https://github.com/maximecb/gym-minigrid/blob/master/gym_minigrid/envs/empty.py

The rest of the logic you are looking for is in minigrid.py: https://github.com/maximecb/gym-minigrid/blob/master/gym_minigrid/minigrid.py

In particular, the process_vis function computes a visibility mask, the cells that are visible to the agent. It basically propagates visibility forward until a wall or closed door is hit.

For moving obstacles, if you just want one environment, I would suggest overriding the step function in your new environment class. Keep track of your moving object, and update its position using self.grid.set(i, j, object). Since the motion of your obstacle is random, you will likely want to use the self.env._rand_int() method. This will ensure that you always get the same behavior in your environment given the same seed.

Let me know if you have any other questions.

@Suman7495
Copy link
Contributor Author

Thank you for your perfect guidelines.

I was able to successfully add a new environment with Dynamic Obstacles. This environment will be used for research at TU Darmstadt testing novel RL algorithms for mobile robot navigation with dynamic obstacles. Here is the link to the branch. I have added a short description of the environment in the README under the section of "Dynamic obstacles environment".

It may be useful to merge this branch with the master for future robotics research.

Thank you.

@maximecb
Copy link
Contributor

maximecb commented Mar 9, 2019

Well done! I would be happy to merge it if you create a pull request :)

@Suman7495
Copy link
Contributor Author

I will do it soon. I just found a small bug. I'll rectify it and get back to you.

@Suman7495
Copy link
Contributor Author

I have created the pull request :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants