2828 RandomCubePosLab ,
2929 SimWrapper ,
3030)
31+ from rcsss .envs .space_utils import Vec7Type
3132from rcsss .envs .utils import (
3233 default_fr3_hw_gripper_cfg ,
3334 default_fr3_hw_robot_cfg ,
@@ -306,18 +307,17 @@ def __call__( # type: ignore
306307
307308class CamRobot (gym .Wrapper ):
308309
309- def __init__ (self , env ):
310+ def __init__ (self , env , cam_robot_joints : Vec7Type ):
310311 super ().__init__ (env )
311312 self .unwrapped : FR3Env
312313 assert isinstance (self .unwrapped .robot , sim .FR3 ), "Robot must be a sim.FR3 instance."
313314 self .sim = env .get_wrapper_attr ("sim" )
314315 self .cam_robot = rcsss .sim .FR3 (self .sim , "1" , env .unwrapped .robot .get_ik ())
315316 self .cam_robot .set_parameters (default_fr3_sim_robot_cfg ("lab_simple_pick_up_digit_hand" ))
317+ self .cam_robot_joints = cam_robot_joints
316318
317319 def step (self , action : dict ):
318- self .cam_robot .set_joints_hard (
319- [- 0.78452318 , - 1.18096017 , 1.75158399 , - 1.0718541 , - 0.11207275 , 1.01050546 , 2.47343638 ]
320- )
320+ self .cam_robot .set_joints_hard (self .cam_robot_joints )
321321 obs , reward , done , truncated , info = super ().step (action )
322322 return obs , reward , done , truncated , info
323323
@@ -330,6 +330,7 @@ def reset(self, *, seed=None, options=None):
330330class FR3LabPickUpSimDigitHand (EnvCreator ):
331331 def __call__ ( # type: ignore
332332 self ,
333+ cam_robot_joints : Vec7Type ,
333334 render_mode : str = "human" ,
334335 control_mode : str = "xyzrpy" ,
335336 resolution : tuple [int , int ] | None = None ,
@@ -368,7 +369,7 @@ def __call__( # type: ignore
368369 sim_wrapper = RandomCubePosLab ,
369370 )
370371 env_rel = FR3LabPickUpSimSuccessWrapper (env_rel )
371- env_rel = CamRobot (env_rel )
372+ env_rel = CamRobot (env_rel , cam_robot_joints )
372373 if render_mode == "human" :
373374 sim = env_rel .get_wrapper_attr ("sim" )
374375 sim .open_gui ()
0 commit comments