Skip to content

Commit

Permalink
created cleanup_articulated task
Browse files Browse the repository at this point in the history
  • Loading branch information
snasiriany committed Apr 12, 2022
1 parent 1659768 commit def5423
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
8 changes: 8 additions & 0 deletions calvin_env/envs/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 2 additions & 0 deletions calvin_env/scripts/gather_task_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
23 changes: 14 additions & 9 deletions calvin_env/scripts/gather_task_data.sh
Original file line number Diff line number Diff line change
@@ -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 &
1 change: 1 addition & 0 deletions conf/tasks/new_playtable_tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit def5423

Please sign in to comment.