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_boundary_target(self, poisson_lambda=300):
      if self._generate_boundary_target_flag == True:
          self._generate_boundary_target_flag = False
          self._generate_boundary_table()
          self._boundary_index = 0
      nsteps = self.time_limit + 1
      velocity = np.zeros(nsteps)
      heading = np.zeros(nsteps)
  
      velocity[0] = 1.25
      heading[0] = 0
      trajectory = self._boundary_table[self._boundary_index]
  
      change = np.cumsum(np.random.poisson(poisson_lambda, 10))
      target_change_times = 0
      for i in range(1, nsteps):
          velocity[i] = velocity[i - 1]
          heading[i] = heading[i - 1]
          if i in change:
              velocity[i] += trajectory[target_change_times][1]
              heading[i] += trajectory[target_change_times][0]
              # trajectory has length 3, the target_change_times should not be large than 2
              target_change_times = min(2, target_change_times + 1)
  
      self._boundary_index = (self._boundary_index + 1) % 64
  
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 4 for calling the CustomR2Env obj's underlying member method code with example usage: obj.generate_boundary_target(poisson_lambda) without return types