class_docstr: Basically same feature processing as official.
  
  Reference: https://github.com/stanfordnmbl/osim-rl/blob/master/osim/env/osim.py
class_docstr_tok: ["Basically","same","feature","processing","as","official",".","Reference",":","https",":","\/\/github.com\/stanfordnmbl\/osim-rl\/blob\/master\/osim\/env\/osim.py"]
code: def _get_observation(self, state_desc):
      obs_dict = self._get_observation_dict(state_desc)
      res = []
  
      # target velocity field (in body frame)
      # v_tgt = np.ndarray.flatten(obs_dict['v_tgt_field'])
      # res += v_tgt.tolist()
  
      res.append(obs_dict["pelvis"]["height"])
      res.append(obs_dict["pelvis"]["pitch"])
      res.append(obs_dict["pelvis"]["roll"])
      res.append(obs_dict["pelvis"]["vel"][0])
      res.append(obs_dict["pelvis"]["vel"][1])
      res.append(obs_dict["pelvis"]["vel"][2])
      res.append(obs_dict["pelvis"]["vel"][3])
      res.append(obs_dict["pelvis"]["vel"][4])
      res.append(obs_dict["pelvis"]["vel"][5])
  
      for leg in ["r_leg", "l_leg"]:
          res += obs_dict[leg]["ground_reaction_forces"]
          res.append(obs_dict[leg]["joint"]["hip_abd"])
          res.append(obs_dict[leg]["joint"]["hip"])
          res.append(obs_dict[leg]["joint"]["knee"])
          res.append(obs_dict[leg]["joint"]["ankle"])
          res.append(obs_dict[leg]["d_joint"]["hip_abd"])
          res.append(obs_dict[leg]["d_joint"]["hip"])
          res.append(obs_dict[leg]["d_joint"]["knee"])
          res.append(obs_dict[leg]["d_joint"]["ankle"])
          for MUS in [
              "HAB",
              "HAD",
              "HFL",
              "GLU",
              "HAM",
              "RF",
              "VAS",
              "BFSH",
              "GAS",
              "SOL",
              "TA",
          ]:
              res.append(obs_dict[leg][MUS]["f"])
              res.append(obs_dict[leg][MUS]["l"])
              res.append(obs_dict[leg][MUS]["v"])
  
      res = np.array(res)
  
      res = self.feature_normalize(
          res,
          mean=self.mean,
          std=self.std,
          duplicate_id=self.duplicate_id,
      )
  
      remaining_time = (
          (self.step_fea - (self.max_timelimit / 2.0))
          / (self.max_timelimit / 2.0)
          * -1.0
      )
      res = np.append(res, remaining_time)
  
      # target driven (Relative coordinate system)
      current_v_x = obs_dict["pelvis"]["vel"][0]  # (+) forward
      current_v_z = obs_dict["pelvis"]["vel"][1]  # (+) leftward
  
      # future vels (0m, 1m, ..., 5m)
      for index in range(5, 11):
          target_v_x, target_v_z = (
              state_desc["v_tgt_field"][0][index][5],
              state_desc["v_tgt_field"][1][index][5],
          )
  
          diff_vel_x = target_v_x - current_v_x
          diff_vel_z = target_v_z - current_v_z
          diff_vel = np.sqrt(
              target_v_x**2 + target_v_z**2
          ) - np.sqrt(current_v_x**2 + current_v_z**2)
          res = np.append(
              res, [diff_vel_x / 5.0, diff_vel_z / 5.0, diff_vel / 5.0]
          )
  
      # current relative target theta
      target_v_x, target_v_z = (
          state_desc["v_tgt_field"][0][5][5],
          state_desc["v_tgt_field"][1][5][5],
      )
      target_theta = math.atan2(target_v_z, target_v_x)
  
      diff_theta = target_theta
  
      res = np.append(res, [diff_theta / np.pi])
  
      return res
  
imports: import copy
  import numpy
  import gym
  import abc
  import math
  from osim.env import L2M2019Env
  from parl.utils import logger
label_desc: Use image node_id 3 for calling the OfficialObs obj's underlying member method code with example usage: obj._get_observation(state_desc) and returns: res