Git Product home page Git Product logo

Comments (2)

Mr-Pepe avatar Mr-Pepe commented on August 16, 2024

There is a collision detection in maze_env.py.

x, y = pos
structure = self._maze_map
size_scaling = self._maze_size_scaling
for i in range(len(structure)):
  for j in range(len(structure[0])):
    if structure[i][j] == 1:
      minx = j * size_scaling - size_scaling * 0.5 - self._init_torso_x
      maxx = j * size_scaling + size_scaling * 0.5 - self._init_torso_x
      miny = i * size_scaling - size_scaling * 0.5 - self._init_torso_y
      maxy = i * size_scaling + size_scaling * 0.5 - self._init_torso_y
      if minx <= x <= maxx and miny <= y <= maxy:
        return True
return False

The scaling factor is 4 (defined here).

I'm not sure about the point maze.

from d4rl.

josuenassar avatar josuenassar commented on August 16, 2024

Thanks! Given this, for antmaze one way to compute it is given the (x, y) coordinate add 2, divide by 4 and apply to the floor function. One can then use this to index into the array representation for the maze.

For point maze, you subtract by .3 and then apply the floor function (I found this out through trial and error :) )
Thanks again for the quick response!

from d4rl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.