Commit 3f6428fb authored by jameskrw's avatar jameskrw
Browse files

modified primitive skill prompts

parent f420b6a3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ sudo apt install vulkan-tools

Below is outdated for backup purpose:
```
# export CUDA_VISIBLE_DEVICES
# For headless servers, additional setup is required:
# Install required packages
apt-get install -y pciutils
+1 −1
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ class PrimitiveSkillEnv(BaseEnv):
    
    
    def _render(self,info,init_obs=False,valid_actions=None):
        new_info=handle_info(info.copy())
        new_info=handle_info(info.copy(),mask_success=self.config.mask_success)
        object_positions=new_info['obj_positions']
        other_information=new_info['other_info']
        instruction=self.env.instruction()
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ class PrimitiveSkillEnvConfig(BaseEnvConfig):
    action_sep:str= field(default='|')
    record_video: bool = field(default=False)
    video_record_dir: str = field(default='./test')
    mask_success: bool = field(default=False)
    
    def config_id(self) -> str:
        id_fields=["env_id","render_mode","max_actions_per_step"]
+6 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ def build_env(env_id, control_mode="pd_ee_delta_pose", stage=0, record_dir='./te
    return env


def handle_info(info):
def handle_info(info,mask_success=False):
    obj_positions = {}
    other_info = {}
    
@@ -57,6 +57,11 @@ def handle_info(info):
            else:
                other_info[k] = v
    
    if mask_success:
       for k in other_info.keys():
            if "success" in k:
                other_info.pop(k)
    
    return {
        'obj_positions': obj_positions,
        'other_info': other_info
+4 −3
Original line number Diff line number Diff line
@@ -7,15 +7,16 @@ You can command the robot using the following actions:
2. place(x, y, z) # To place the object currently held by the robot's gripper at the target position (x,y,z).
3. push(x1, y1, z1, x2, y2, z2) # To push an object from position (x1,y1,z1) to (x2,y2,z2).

Note: 
Hints: 
1. The coordinates (x, y, z) are in millimeters and are all integers.
2. Please ensure that the coordinates are within the workspace limits.
3. The position is the center of the object, when you place, please consider the volume of the obeject. It's always fine to set z much higher.

Please think step by step and provide the actions you want to take.
You can take up to {max_actions_per_step} action(s) at a time, separated by {action_sep}. 
Your reponse should be in the format of <think>...</think><answer>...</answer>.
e.g.
<think>The next step should be picking up cubeA and place it at the targetA. I should use the 'pick' and 'place' action with the coordinates of the cubeA and targetA.</think><answer>pick(-80,100,20){action_sep}place(200,341,534)</answer>
e.g. <think>I need to pick obj A (100,100,100) first and place it at the obj B (200,200,200)</think><answer>pick(100,100,100)|place(200,200,400)</answer>
e.g. <think>I should push obj A (100,200,20) along the y axis</think><answer>push(100,200,20,100,400,20)</answer>
"""

init_observation_template = """
Loading