Farama-Foundation / Gymnasium-Robotics

A collection of robotics simulation environments for reinforcement learning
https://robotics.farama.org/
MIT License
573 stars 91 forks source link

[Bug Report] MazeEnv Goal Used is in i,j but should be x,y #226

Closed llewynS closed 1 month ago

llewynS commented 2 months ago

If you are submitting a bug report, please fill in the following details and use the tag [bug].

Describe the bug The goal in generate_target_goal is selected from maze.unique_goal_locations which is in i,j coordinates and is never converted to x,y so the goal will be in the wrong coordinate system for comparison.

Code example It's in the source code:

    def generate_target_goal(self) -> np.ndarray:
        assert len(self.maze.unique_goal_locations) > 0
        goal_index = self.np_random.integers(
            low=0, high=len(self.maze.unique_goal_locations)
        )
        goal = self.maze.unique_goal_locations[goal_index].copy()
        return goal

called in reset as

if options is None:
            goal = self.generate_target_goal()
            # Add noise to goal position
            self.goal = self.add_xy_position_noise(goal)

and add_xy_position_noise(goal) does not convert to x,y

System Info This is reading the source code in this repository.

Checklist

llewynS commented 2 months ago

Actually further reading it just looks like the comments indicating that unique_goal_location are in (i,j) are incorrect and the comment should simply read (x,y) instead.

Kallinteris-Andreas commented 2 months ago

so this is a comment only issue?