Commit 15735b34 authored by jameskrw's avatar jameskrw
Browse files

minor

parent e2100fb8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ class PrimitiveSkillEnv(BaseEnv):
    
    
    def _render(self,info,init_obs=False,valid_actions=None):
        print("info",info)
        new_info=handel_info(info.copy())
        object_positions=new_info['obj_positions']
        other_information=new_info['other_info']
@@ -216,7 +217,8 @@ if __name__ == "__main__":
    This code demonstrates how to create an instance of the environment,
    reset it, and interact with it using manual input actions.
    """
    config = PrimitiveSkillEnvConfig(record_video=True, video_record_dir="./test_manipulation_video")
    # AlignTwoCube,PlaceTwoCube,PutAppleInDrawer,StackThreeCube
    config = PrimitiveSkillEnvConfig(record_video=True, video_record_dir="./test_manipulation_video",env_id="AlignTwoCube", render_mode="vision")
    env = PrimitiveSkillEnv(config)
    
    print(env.system_prompt())
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ class StackThreeCubeEnv(BaseEnv):
        for name in self.object_list:
            info[f"is_{name}_grasped"] = self.agent.is_grasping(self.object_list[name])[0]
            info[f"{name}_pos"] = self.object_list[name].pose.p[0]
        info["cube_size"]=torch.ones_like(info["red_cube_pos"])*40
        info["cube_size"]=torch.ones_like(info["red_cube_pos"])*0.04
        info["gripper_pos"] = self.agent.tcp.pose.p[0]
        return info

+4 −2
Original line number Diff line number Diff line
@@ -39,9 +39,11 @@ def handel_info(info):
            # convert to cm round to 2 decimal places
            obj_positions[k] = tuple(np.round(v*1000, 0).astype(int))
        elif k.endswith('_value'):
            obj_positions[k] = np.round(v*1000, 0).astype(int).item()
            other_info[k] = np.round(v*1000, 0).astype(int).item()
        elif k.endswith('_size'):
            other_info[k] = tuple(np.round(v*1000, 0).astype(int))
        else:
            if isinstance(v, np.ndarray):
            if isinstance(v, np.ndarray) and v.ndim == 0:
                other_info[k] = v.item()
            else:
                other_info[k] = v
+1 −1
Original line number Diff line number Diff line
@@ -2,6 +2,6 @@ env1:
    env_name: primitive_skill 
    env_config:
        render_mode: text
        env_id: "PlaceTwoCube" # AlignTwoCube,PlaceTwoCube,PutAppleInDrawer,StackThreeCube
        env_id: "StackThreeCube" # AlignTwoCube,PlaceTwoCube,PutAppleInDrawer,StackThreeCube
    train_size: 10000  
    test_size: 32
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ python -m vagen.trainer.main_ppo \
    data.train_batch_size=8 \
    data.max_prompt_length=1024 \
    data.max_response_length=128 \
    data.max_trajectory_length=1500 \
    data.max_trajectory_length=1800 \
    data.image_key=images \
    data.truncation=error \
    actor_rollout_ref.model.path=Qwen/Qwen2.5-0.5B-Instruct \