diff --git a/calvin_env/envs/tasks.py b/calvin_env/envs/tasks.py index 1c46672..bdbc1b3 100644 --- a/calvin_env/envs/tasks.py +++ b/calvin_env/envs/tasks.py @@ -327,3 +327,11 @@ def cleanup(blocks, start_info, end_info): light = Tasks.toggle_light('lightbulb', 1, 0, start_info, end_info) led = Tasks.toggle_light('led', 1, 0, start_info, end_info) return (all(block_in_drawer) and drawer and light and led) + + @staticmethod + def cleanup_articulated(start_info, end_info): + drawer = end_info["scene_info"]["doors"]["base__drawer"]["current_state"] < 0.02 + light = Tasks.toggle_light('lightbulb', 1, 0, start_info, end_info) + led = Tasks.toggle_light('led', 1, 0, start_info, end_info) + slider_right = Tasks.move_door_rel('base__slide', -0.15, start_info, end_info) + return (drawer and light and led and slider_right) diff --git a/calvin_env/scripts/gather_task_data.py b/calvin_env/scripts/gather_task_data.py index 882ff9c..f19d732 100644 --- a/calvin_env/scripts/gather_task_data.py +++ b/calvin_env/scripts/gather_task_data.py @@ -119,6 +119,8 @@ def gen_task_dataset(args): 'push_red_block_right', 'stack_block', 'place_in_slider', + 'move_slider_left', + 'move_slider_right', ], required=True, ) diff --git a/calvin_env/scripts/gather_task_data.sh b/calvin_env/scripts/gather_task_data.sh index eeede77..12129f6 100644 --- a/calvin_env/scripts/gather_task_data.sh +++ b/calvin_env/scripts/gather_task_data.sh @@ -1,11 +1,16 @@ #!/bin/bash -python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task open_drawer & -python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task close_drawer & -python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task turn_off_lightbulb & -python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task turn_off_led & -python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task place_in_drawer & -python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task push_into_drawer & -python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task lift_pink_block_drawer & -python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task lift_pink_block_table & -python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task rotate_pink_block_right & +#python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task open_drawer & +#python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task close_drawer & +#python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task turn_off_lightbulb & +#python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task turn_off_led & +#python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task place_in_drawer & +#python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task push_into_drawer & +#python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task lift_pink_block_drawer & +#python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task lift_pink_block_table & +#python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task rotate_pink_block_right & + +python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task turn_on_led & +python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task turn_on_lightbulb & +python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task move_slider_left & +python calvin/calvin_env/calvin_env/scripts/gather_task_data.py --task move_slider_right & diff --git a/conf/tasks/new_playtable_tasks.yaml b/conf/tasks/new_playtable_tasks.yaml index 4669c32..9342d71 100644 --- a/conf/tasks/new_playtable_tasks.yaml +++ b/conf/tasks/new_playtable_tasks.yaml @@ -55,6 +55,7 @@ tasks: cleanup: [cleanup, ['block_red', 'block_blue', 'block_pink']] cleanup_pink: [cleanup, ['block_pink']] cleanup_pink_easy: [cleanup, ['block_pink']] + cleanup_articulated: [cleanup_articulated] # signatures of available base tasks: # rotate_object(obj_name, degrees, x_y_threshold=30, z_treshold=180):