File tree Expand file tree Collapse file tree
robosuite/controllers/composite Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -122,6 +122,20 @@ def get_control_dim(self, part_name):
122122 return self .part_controllers [part_name ].control_dim
123123
124124 def get_controller_base_pose (self , controller_name ):
125+ """
126+ Get the base position and orientation of a specified controller's part. Note: this pose may likely differ from
127+ the robot base's pose.
128+ Args:
129+ controller_name (str): The name of the controller, used to look up part-specific information.
130+ Returns:
131+ tuple[np.ndarray, np.ndarray]: A tuple containing:
132+ - base_pos (np.ndarray): The 3D position of the part's center in world coordinates (shape: (3,)).
133+ - base_ori (np.ndarray): The 3x3 rotation matrix representing the part's orientation in world coordinates.
134+ Details:
135+ - Uses the controller's `naming_prefix` and `part_name` to construct the corresponding site name.
136+ - Queries the simulation (`self.sim`) for the site's position (`site_xpos`) and orientation (`site_xmat`).
137+ - The site orientation matrix is reshaped from a flat array of size 9 to a 3x3 rotation matrix.
138+ """
125139 naming_prefix = self .part_controllers [controller_name ].naming_prefix
126140 part_name = self .part_controllers [controller_name ].part_name
127141 base_pos = np .array (self .sim .data .site_xpos [self .sim .model .site_name2id (f"{ naming_prefix } { part_name } _center" )])
You can’t perform that action at this time.
0 commit comments