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

Method get_next_state

TextOpTracker/scripts/csv_to_npz.py:188–215  ·  view source on GitHub ↗

Gets the next state of the motion.

(
        self,
    )

Source from the content-addressed store, hash-verified

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
218def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene, joint_names: list[str], MotionLoaderCls=MotionLoader):

Callers 1

run_simulatorFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected