Skip to content

[Bug Report] The tasks_to_complete variable does not reset properly in FrankaKitchen-v1 #166

@greg3566

Description

@greg3566

Describe the bug
The tasks_to_complete variable does not reset properly in FrankaKitchen-v1. The info['tasks_to_complete'] returned from the reset() function does match the tasks_to_complete argument passed when initializing the environment. However, in subsequent calls to the step() function, the info['tasks_to_complete'] excludes tasks removed in the previous episode. Also, no reward will be generated from the removed tasks.

Code example

env = gym.make('FrankaKitchen-v1', tasks_to_complete=['microwave', 'kettle'])

After creating the environment, complete the kettle task in an episode and then execute the following code:

obs, info = env.reset()
print(info['tasks_to_complete'])
obs, reward, terminated, truncated, info = env.step(env.action_space.sample())
print(info['tasks_to_complete'], info['episode_task_completions'])

This will output:

{'kettle', 'microwave'}
['microwave'] []

Solution
Change task_to_complete to tasks_to_complete in reset function of kitchen_env:

        self.tasks_to_complete = set(self.goal.keys())
        info = {
            "tasks_to_complete": self.tasks_to_complete,
            "episode_task_completions": [],
            "step_task_completions": [],
        }

System Info

  • pip install within a conda env
  • Ubuntu 20.04
  • Python 3.8

Checklist

  • I have checked that there is no similar issue in the repo (required)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions