@@ -45,45 +45,49 @@ def load_creds_franka_desk(postfix: str = "") -> tuple[str, str]:
4545 return os .environ [username_key ], os .environ [password_key ]
4646
4747
48- def home (ip : str , username : str , password : str , shut : bool , unlock : bool = False , fh : bool = False ):
49- with Desk .fci (ip , username , password , unlock = unlock ):
48+ def home (ip : str ):
49+ default_env = DefaultFR3HardwareEnv ()
50+ default_env .ip = ip
51+ env_cfg = default_env .config ()
52+ robot_cfg = env_cfg .robot_cfg
53+ robot_cfg .speed_factor = 0.2
54+ f = rcs_fr3 .hw .Franka (robot_cfg )
55+ f .move_home ()
56+
57+
58+ def gripper (ip : str , close_gripper : bool ):
59+
60+ default_env = DefaultFR3HardwareEnv ()
61+ default_env .ip = ip
62+ env_cfg = default_env .config ()
63+ config_hand = env_cfg .gripper_cfg
64+ assert isinstance (config_hand , rcs_fr3 .hw .FHConfig )
65+ g = rcs_fr3 .hw .FrankaHand (config_hand )
66+ if close_gripper :
67+ g .shut ()
68+ else :
69+ g .open ()
70+
71+
72+ def info (ip : str , include_hand : bool = False ):
73+ robot_cfg = rcs_fr3 .hw .FR3Config (ip = ip )
74+ robot_cfg .speed_factor = 0.2
75+ f = rcs_fr3 .hw .Franka (robot_cfg )
76+ print ("Robot info:" )
77+ print ("Current cartesian position:" )
78+ print (f .get_cartesian_position ())
79+ print ("Current joint position:" )
80+ print (f .get_joint_position ())
81+ if include_hand :
5082 default_env = DefaultFR3HardwareEnv ()
5183 default_env .ip = ip
5284 env_cfg = default_env .config ()
53- robot_cfg = env_cfg .robot_cfg
54- robot_cfg .speed_factor = 0.2
55- f = rcs_fr3 .hw .Franka (robot_cfg )
56- if fh :
57- config_hand = env_cfg .gripper_cfg
58- assert isinstance (config_hand , rcs_fr3 .hw .FHConfig )
59- g = rcs_fr3 .hw .FrankaHand (config_hand )
60- if shut :
61- g .shut ()
62- else :
63- g .open ()
64- f .move_home ()
65-
66-
67- def info (ip : str , username : str , password : str , include_hand : bool = False ):
68- with Desk .fci (ip , username , password ):
69- robot_cfg = rcs_fr3 .hw .FR3Config (ip = ip )
70- robot_cfg .speed_factor = 0.2
71- f = rcs_fr3 .hw .Franka (robot_cfg )
72- print ("Robot info:" )
73- print ("Current cartesian position:" )
74- print (f .get_cartesian_position ())
75- print ("Current joint position:" )
76- print (f .get_joint_position ())
77- if include_hand :
78- default_env = DefaultFR3HardwareEnv ()
79- default_env .ip = ip
80- env_cfg = default_env .config ()
81- config_hand = env_cfg .gripper_cfg
82- assert isinstance (config_hand , rcs_fr3 .hw .FHConfig )
83- g = rcs_fr3 .hw .FrankaHand (config_hand )
84- print ("Gripper info:" )
85- print ("Current normalized width:" )
86- print (g .get_normalized_width ())
85+ config_hand = env_cfg .gripper_cfg
86+ assert isinstance (config_hand , rcs_fr3 .hw .FHConfig )
87+ g = rcs_fr3 .hw .FrankaHand (config_hand )
88+ print ("Gripper info:" )
89+ print ("Current normalized width:" )
90+ print (g .get_normalized_width ())
8791
8892
8993def lock (ip : str , username : str , password : str ):
0 commit comments