class_docstr: A reward shaping wrapper
class_docstr_tok: ["A","reward","shaping","wrapper"]
code: def reward_shaping(self, state_desc, env_reward, done, action, info):
      # Reward for not falling down
      reward = 10.0
  
      yaw = state_desc["joint_pos"]["ground_pelvis"][2]
      current_v_x, current_v_z = rotate_frame(
          state_desc["body_vel"]["pelvis"][0],
          state_desc["body_vel"]["pelvis"][2],
          yaw,
      )
      # leftward (Attention!!!)
      current_v_z = -current_v_z
  
      # 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],
      )
  
      vel_penalty = np.linalg.norm(
          [target_v_x - current_v_x, target_v_z - current_v_z]
      )
  
      muscle_penalty = 0
      for muscle in sorted(state_desc["muscles"].keys()):
          muscle_penalty += np.square(
              state_desc["muscles"][muscle]["activation"]
          )
  
      ret_r = (
          reward
          - (
              vel_penalty * self.vel_penalty_coeff
              + muscle_penalty * self.muscle_penalty_coeff
          )
          * self.penalty_coeff
      )
  
      info = {
          "shaping_reward": ret_r,
          "env_reward": env_reward,
      }
      return info
  
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 FinalReward obj's underlying member method code with example usage: obj.reward_shaping(state_desc, env_reward, done, action, info) and returns: info