summaryrefslogtreecommitdiff
path: root/examples/pybullet/gym/pybullet_envs/deep_mimic/env/motion_capture_data.py
blob: 7a9c86b762cc4a4dd38c2e3c597a76122d1b3346 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import json

class MotionCaptureData(object):
  def __init__(self):
    self.Reset()

  def Reset(self):
    self._motion_data = []

  def Load(self, path):
    with open(path, 'r') as f:
      self._motion_data = json.load(f)

  def NumFrames(self):
    return  len(self._motion_data['Frames'])

  def KeyFrameDuraction(self):
  	return self._motion_data['Frames'][0][0]