Gets the next state of the motion.
(
self,
)
| 192 | return omega |
| 193 | |
| 194 | def get_next_state( |
| 195 | self, |
| 196 | ) -> tuple[ |
| 197 | tuple[ |
| 198 | torch.Tensor, |
| 199 | torch.Tensor, |
| 200 | torch.Tensor, |
| 201 | torch.Tensor, |
| 202 | torch.Tensor, |
| 203 | torch.Tensor, |
| 204 | ], |
| 205 | bool, |
| 206 | ]: |
| 207 | """Gets the next state of the motion.""" |
| 208 | state = ( |
| 209 | self.motion_base_poss[self.current_idx : self.current_idx + 1], |
| 210 | self.motion_base_rots[self.current_idx : self.current_idx + 1], |
| 211 | self.motion_base_lin_vels[self.current_idx : self.current_idx + 1], |
| 212 | self.motion_base_ang_vels[self.current_idx : self.current_idx + 1], |
| 213 | self.motion_dof_poss[self.current_idx : self.current_idx + 1], |
| 214 | self.motion_dof_vels[self.current_idx : self.current_idx + 1], |
| 215 | ) |
| 216 | self.current_idx += 1 |
| 217 | reset_flag = False |
| 218 | if self.current_idx >= self.output_frames: |
| 219 | self.current_idx = 0 |
| 220 | reset_flag = True |
| 221 | return state, reset_flag |
| 222 | |
| 223 | |
| 224 | def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene, joint_names: list[str], motion_data: dict, motion_name: str): |