robosuite_task_zoo/environments/manipulation/kitchen.py
def _setup_references(self):
        """
        Sets up references to important components. A reference is typically an
        index or a list of indices that point to the corresponding elements
        in a flatten array, which is how MuJoCo stores physical simulation data.
        """
        super()._setup_references()

        # Additional object references from this env
        self.object_body_ids = dict()
        self.object_body_ids["stove_1"] = self.sim.model.body_name2id(self.stove_object_1.root_body)
        # self.object_body_ids["stove_2"] = self.sim.model.body_name2id(self.stove_object_2.root_body)        

        self.pot_object_id = self.sim.model.body_name2id(self.pot_object.root_body)
        self.button_qpos_addrs.update({1: self.sim.model.get_joint_qpos_addr(self.button_object_1.joints[0])})
        # self.button_qpos_addrs.update({2: self.sim.model.get_joint_qpos_addr(self.button_object_2.joints[0])})

        self.serving_region_id = self.sim.model.body_name2id(self.serving_region.root_body)
        
        self.sim.data.set_joint_qpos(self.button_object_1.joints[0], np.array([-0.4]))

        self.obj_body_id = {}        
        for obj in self.objects:
            self.obj_body_id[obj.name] = self.sim.model.body_name2id(obj.root_body)

        Sets up references to important components. A reference is typically an
        index or a list of indices that point to the corresponding elements
        in a flatten array, which is how MuJoCo stores physical simulation data.
        
Sets up references to important components. A reference is typically an
index or a list of indices that point to the corresponding elements
in a flatten array, which is how MuJoCo stores physical simulation data.
Sets up references to important components . A reference is typically an index or a list of indices that point to the corresponding elements in a flatten array which is how MuJoCo stores physical simulation data .
def _setup_references(self):
        super()._setup_references()
        self.object_body_ids = dict()
        self.object_body_ids["stove_1"] = self.sim.model.body_name2id(self.stove_object_1.root_body)
        self.pot_object_id = self.sim.model.body_name2id(self.pot_object.root_body)
        self.button_qpos_addrs.update({1: self.sim.model.get_joint_qpos_addr(self.button_object_1.joints[0])})
        self.serving_region_id = self.sim.model.body_name2id(self.serving_region.root_body)
        self.sim.data.set_joint_qpos(self.button_object_1.joints[0], np.array([-0.4]))
        self.obj_body_id = {}        
        for obj in self.objects:
            self.obj_body_id[obj.name] = self.sim.model.body_name2id(obj.root_body)
def _setup_references ( self ) : super ( ) . _setup_references ( ) self . object_body_ids = dict ( ) self . object_body_ids [ "stove_1" ] = self . sim . model . body_name2id ( self . stove_object_1 . root_body ) self . pot_object_id = self . sim . model . body_name2id ( self . pot_object . root_body ) self . button_qpos_addrs . update ( { 1 : self . sim . model . get_joint_qpos_addr ( self . button_object_1 . joints [ 0 ] ) } ) self . serving_region_id = self . sim . model . body_name2id ( self . serving_region . root_body ) self . sim . data . set_joint_qpos ( self . button_object_1 . joints [ 0 ] , np . array ( [ - 0.4 ] ) ) self . obj_body_id = { } for obj in self . objects : self . obj_body_id [ obj . name ] = self . sim . model . body_name2id ( obj . root_body )
Sets up references to important components.
Sets up references to important components .
"""
        Sets up references to important components. A reference is typically an
        index or a list of indices that point to the corresponding elements
        in a flatten array, which is how MuJoCo stores physical simulation data.
        """ # Additional object references from this env # self.object_body_ids["stove_2"] = self.sim.model.body_name2id(self.stove_object_2.root_body)         # self.button_qpos_addrs.update({2: self.sim.model.get_joint_qpos_addr(self.button_object_2.joints[0])})
self