MCPcopy Create free account
hub / github.com/TeleHuman/TextOp / get_next_state

Method get_next_state

TextOpTracker/scripts/pklpack_to_npz.py:194–221  ·  view source on GitHub ↗

Gets the next state of the motion.

(
        self,
    )

Source from the content-addressed store, hash-verified

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
224def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene, joint_names: list[str], motion_data: dict, motion_name: str):

Callers 1

run_simulatorFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected