88from rcsss ._core .hw import FR3Config , IKController
99from rcsss ._core .sim import CameraType
1010from rcsss .camera .sim import SimCameraConfig , SimCameraSet , SimCameraSetConfig
11- from rcsss .desk import FCI , Desk , DummyResourceManager
11+ from rcsss .control .fr3_desk import FCI , Desk , DummyResourceManager
12+ from rcsss .control .utils import load_creds_fr3_desk
1213from rcsss .envs .base import RobotInstance
1314
1415ROBOT_IP = "192.168.101.1"
@@ -37,14 +38,11 @@ def main():
3738 logger .error ("This pip package was not built with the UTN lab models, aborting." )
3839 sys .exit ()
3940 if ROBOT_INSTANCE == RobotInstance .HARDWARE :
40- creds = dotenv_values ()
41- resource_manger = FCI (
42- Desk (ROBOT_IP , creds ["FR3_USERNAME" ], creds ["FR3_PASSWORD" ]), unlock = False , lock_when_done = False
43- )
41+ user , pw = load_creds_fr3_desk ()
42+ resource_manger = FCI (Desk (ROBOT_IP , user , pw ), unlock = False , lock_when_done = False )
4443 else :
4544 resource_manger = DummyResourceManager ()
4645
47-
4846 with resource_manger :
4947 if ROBOT_INSTANCE == RobotInstance .SIMULATION :
5048 simulation = sim .Sim (rcsss .scenes ["fr3_empty_world" ])
@@ -60,13 +58,16 @@ def main():
6058
6159 # add camera to have a rendering gui
6260 cameras = {
63- "default_free" : SimCameraConfig (identifier = "" , type = int (CameraType .default_free ), on_screen_render = True ),
64- "wrist" : SimCameraConfig (identifier = "eye-in-hand_0" , type = int (CameraType .fixed ), on_screen_render = False ),
61+ "default_free" : SimCameraConfig (
62+ identifier = "" , type = int (CameraType .default_free ), on_screen_render = True
63+ ),
64+ "wrist" : SimCameraConfig (
65+ identifier = "eye-in-hand_0" , type = int (CameraType .fixed ), on_screen_render = False
66+ ),
6567 # TODO: odd behavior when not both cameras are used: only last image is shown
6668 }
6769 cam_cfg = SimCameraSetConfig (cameras = cameras , resolution_width = 1280 , resolution_height = 720 , frame_rate = 20 )
6870 camera_set = SimCameraSet (simulation , cam_cfg )
69- resource_manger = DummyResourceManager ()
7071
7172 else :
7273 robot = rcsss .hw .FR3 (ROBOT_IP , str (rcsss .scenes ["lab" ].parent / "fr3.urdf" ))
@@ -80,13 +81,8 @@ def main():
8081 gripper_cfg .speed = 0.1
8182 gripper_cfg .force = 30
8283 gripper = rcsss .hw .FrankaHand (ROBOT_IP , gripper_cfg )
83- creds = dotenv_values ()
84- resource_manger = FCI (
85- Desk (ROBOT_IP , creds ["FR3_USERNAME" ], creds ["FR3_PASSWORD" ]), unlock = False , lock_when_done = False
86- )
8784 input ("the robot is going to move, press enter whenever you are ready" )
8885
89-
9086 # move to home position and open gripper
9187 robot .move_home ()
9288 gripper .open ()
0 commit comments