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