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_dict(self, state_desc):
      obs_dict = {}
  
      obs_dict["v_tgt_field"] = state_desc["v_tgt_field"]
  
      # pelvis state (in local frame)
      obs_dict["pelvis"] = {}
      obs_dict["pelvis"]["height"] = state_desc["body_pos"]["pelvis"][1]
      obs_dict["pelvis"]["pitch"] = -state_desc["joint_pos"][
          "ground_pelvis"
      ][
          0
      ]  # (+) pitching forward
      obs_dict["pelvis"]["roll"] = state_desc["joint_pos"][
          "ground_pelvis"
      ][
          1
      ]  # (+) rolling around the forward axis (to the right)
      yaw = state_desc["joint_pos"]["ground_pelvis"][2]
      dx_local, dy_local = rotate_frame(
          state_desc["body_vel"]["pelvis"][0],
          state_desc["body_vel"]["pelvis"][2],
          yaw,
      )
      dz_local = state_desc["body_vel"]["pelvis"][1]
      obs_dict["pelvis"]["vel"] = [
          dx_local,  # (+) forward
          -dy_local,  # (+) leftward
          dz_local,  # (+) upward
          -state_desc["joint_vel"]["ground_pelvis"][
              0
          ],  # (+) pitch angular velocity
          state_desc["joint_vel"]["ground_pelvis"][
              1
          ],  # (+) roll angular velocity
          state_desc["joint_vel"]["ground_pelvis"][2],
      ]  # (+) yaw angular velocity
  
      # leg state
      for leg, side in zip(["r_leg", "l_leg"], ["r", "l"]):
          obs_dict[leg] = {}
          grf = [
              f / (self.MASS * self.G)
              for f in state_desc["forces"]["foot_{}".format(side)][0:3]
          ]  # forces normalized by bodyweight
          grm = [
              m / (self.MASS * self.G)
              for m in state_desc["forces"]["foot_{}".format(side)][3:6]
          ]  # forces normalized by bodyweight
          grfx_local, grfy_local = rotate_frame(-grf[0], -grf[2], yaw)
          if leg == "r_leg":
              obs_dict[leg]["ground_reaction_forces"] = [
                  grfx_local,  # (+) forward
                  grfy_local,  # (+) lateral (rightward)
                  -grf[1],
              ]  # (+) upward
          if leg == "l_leg":
              obs_dict[leg]["ground_reaction_forces"] = [
                  grfx_local,  # (+) forward
                  -grfy_local,  # (+) lateral (leftward)
                  -grf[1],
              ]  # (+) upward
  
          # joint angles
          obs_dict[leg]["joint"] = {}
          obs_dict[leg]["joint"]["hip_abd"] = -state_desc["joint_pos"][
              "hip_{}".format(side)
          ][
              1
          ]  # (+) hip abduction
          obs_dict[leg]["joint"]["hip"] = -state_desc["joint_pos"][
              "hip_{}".format(side)
          ][
              0
          ]  # (+) extension
          obs_dict[leg]["joint"]["knee"] = state_desc["joint_pos"][
              "knee_{}".format(side)
          ][
              0
          ]  # (+) extension
          obs_dict[leg]["joint"]["ankle"] = -state_desc["joint_pos"][
              "ankle_{}".format(side)
          ][
              0
          ]  # (+) extension
          # joint angular velocities
          obs_dict[leg]["d_joint"] = {}
          obs_dict[leg]["d_joint"]["hip_abd"] = -state_desc[
              "joint_vel"
          ]["hip_{}".format(side)][
              1
          ]  # (+) hip abduction
          obs_dict[leg]["d_joint"]["hip"] = -state_desc["joint_vel"][
              "hip_{}".format(side)
          ][
              0
          ]  # (+) extension
          obs_dict[leg]["d_joint"]["knee"] = state_desc["joint_vel"][
              "knee_{}".format(side)
          ][
              0
          ]  # (+) extension
          obs_dict[leg]["d_joint"]["ankle"] = -state_desc["joint_vel"][
              "ankle_{}".format(side)
          ][
              0
          ]  # (+) extension
  
          # muscles
          for MUS, mus in zip(
              [
                  "HAB",
                  "HAD",
                  "HFL",
                  "GLU",
                  "HAM",
                  "RF",
                  "VAS",
                  "BFSH",
                  "GAS",
                  "SOL",
                  "TA",
              ],
              [
                  "abd",
                  "add",
                  "iliopsoas",
                  "glut_max",
                  "hamstrings",
                  "rect_fem",
                  "vasti",
                  "bifemsh",
                  "gastroc",
                  "soleus",
                  "tib_ant",
              ],
          ):
              obs_dict[leg][MUS] = {}
              obs_dict[leg][MUS]["f"] = (
                  state_desc["muscles"]["{}_{}".format(mus, side)][
                      "fiber_force"
                  ]
                  / self.Fmax[leg][MUS]
              )
              obs_dict[leg][MUS]["l"] = (
                  state_desc["muscles"]["{}_{}".format(mus, side)][
                      "fiber_length"
                  ]
                  / self.lopt[leg][MUS]
              )
              obs_dict[leg][MUS]["v"] = (
                  state_desc["muscles"]["{}_{}".format(mus, side)][
                      "fiber_velocity"
                  ]
                  / self.lopt[leg][MUS]
              )
  
      return obs_dict
  
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 2 for calling the OfficialObs obj's underlying member method code with example usage: obj._get_observation_dict(state_desc) and returns: obs_dict