Download tasks/put_mugs_into_pot.py from vietnhat/robodojo-hard-dev: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/datasets/vietnhat/robodojo-hard-dev/resolve/main/tasks/put_mugs_into_pot.py
- Command line
-
hf download hf://datasets/vietnhat/robodojo-hard-dev/tasks/put_mugs_into_pot.py
-
curl -L -o put_mugs_into_pot.py https://huggingface.co/datasets/vietnhat/robodojo-hard-dev/resolve/main/tasks/put_mugs_into_pot.py
1.1 kB
| """Dev task (not in the RoboDojo eval set): put the two mugs into the pot.""" | |
| from env.environment.task_env import TaskEnv | |
| from env.reward_manager.reward_manager import RewardManager | |
| class PutMugsIntoPotCommon: | |
| def __init__(self, config, app, **kwargs): | |
| super().__init__(config, app, **kwargs) | |
| self.reward_manager = RewardManager(self.num_envs) | |
| self.step_lim = 600 | |
| def _post_setup_scene(self, sim): | |
| super()._post_setup_scene(sim) | |
| self.reward_manager.initialize(self) | |
| def reset(self, seed=None, options=None): | |
| super().reset(seed=seed, options=options) | |
| self.reward_manager.reset() | |
| def run_reward(self): | |
| rm = self.reward_manager | |
| rm.check( | |
| [ | |
| rm.is_A_in_B(label_A="mug0", label_B="pot"), | |
| rm.is_A_in_B(label_A="mug1", label_B="pot"), | |
| rm.all_robot_back_to_origin(), | |
| ] | |
| ) | |
| def gen_instruction(self, env_idx): | |
| return ["Put the two mugs into the pot."] | |
| class put_mugs_into_pot(PutMugsIntoPotCommon, TaskEnv): | |
| pass | |