class_docstr: Customized target trajectory here, it support 3 ways currently
  1.fixed_speed, e.g. reset(.., fixed_speed=1.25)
  2.stage , e.g. reset(.., stage=1)
  3.boundary, e.g. reset(.., boundary=True)
class_docstr_tok: ["Customized","target","trajectory","here",",","it","support","3","ways","currently","1.fixed_speed",",","e.g",".","reset","(","..",",","fixed_speed=1.25",")","2.stage",",","e.g",".","reset","(","..",",","stage=1",")","3.boundary",",","e.g",".","reset","(","..",",","boundary=True",")"]
code: def _generate_target_vel(self, stage, change_num):
      target_vels = None
      if stage == 0:
          target_vels = [1.25]
      elif stage == 1:
          assert change_num >= 1
          interval = 1.0 / self.discrete_bin
          discrete_id = np.random.randint(self.discrete_bin)
  
          min_vel = 0.75 + discrete_id * interval
          max_vel = 0.75 + (discrete_id + 1) * interval
  
          target_vels = [1.25]
          for i in range(change_num):
              if i == 0:
                  target_vels.append(random.uniform(min_vel, max_vel))
              else:
                  target_vels.append(
                      target_vels[-1] + random.uniform(-0.5, 0.5)
                  )
      elif stage == 2:
          assert change_num >= 2
          interval = 2.0 / self.discrete_bin
          discrete_id = np.random.randint(self.discrete_bin)
          min_vel = 0.25 + discrete_id * interval
          max_vel = 0.25 + (discrete_id + 1) * interval
          while True:
              target_vels = [1.25]
              for i in range(change_num):
                  target_vels.append(
                      target_vels[-1] + random.uniform(-0.5, 0.5)
                  )
              if (
                  target_vels[2] >= min_vel
                  and target_vels[2] <= max_vel
              ):
                  break
      elif stage == 3:
          assert change_num >= 3
          interval = 3.0 / self.discrete_bin
          discrete_id = np.random.randint(self.discrete_bin)
          min_vel = -0.25 + discrete_id * interval
          max_vel = -0.25 + (discrete_id + 1) * interval
          while True:
              target_vels = [1.25]
              for i in range(change_num):
                  target_vels.append(
                      target_vels[-1] + random.uniform(-0.5, 0.5)
                  )
              if (
                  target_vels[3] >= min_vel
                  and target_vels[3] <= max_vel
              ):
                  break
      else:
          raise NotImplemented
      logger.info(
          "[CustomR2Env] stage: {}, target_vels: {}".format(
              stage, target_vels
          )
      )
      return target_vels
  
imports: import abc
  import gym
  import math
  import numpy
  import random
  from collections import OrderedDict
  from osim.env import ProstheticsEnv
  from parl.utils import logger
  from tqdm import tqdm
label_desc: Use image node_id 5 for calling the CustomR2Env obj's underlying member method code with example usage: obj._generate_target_vel(stage, change_num) and returns: target_vels