parameters: (self,t)
return_statement: return x,v
docstring: Predicts the state that the system will be in at time t>=0 in the
          future, assuming no changes to the target.
  
          Args:
              t (float): the time in the future. Should be >=0.
  
          Returns:
              tuple: (x,v) giving the predicted state
docstring_summary: Predicts the state that the system will be in at time t>=0 in the
          future, assuming no changes to the target.
docstring_tokens: Predicts the state that the system will be in at time t > = 0 in the future assuming no changes to the target .
function: def predict(self,t):
          """Predicts the state that the system will be in at time t>=0 in the
          future, assuming no changes to the target.
  
          Args:
              t (float): the time in the future. Should be >=0.
  
          Returns:
              tuple: (x,v) giving the predicted state
  
          """
          t = t + self.trajTime
          x = []
          v = []
          for i in range(len(self.times)):
              ti,mi,dmi = self.times[i],self.milestones[i],self.dmilestones[i]
              #evaluate trajectory
              j = 0
              xi = mi[-1]
              vi = dmi[-1]
              if t < ti[-1]:
                  while j+1 < len(ti):
                      if t < ti[j+1]:
                          assert t >= ti[j]
                          dt = (ti[j+1]-ti[j])
                          u = (t-ti[j])/dt
                          xi = hermite_eval([mi[j]],[dmi[j]*dt],[mi[j+1]],[dmi[j+1]*dt],u)[0]
                          vi = hermite_deriv([mi[j]],[dmi[j]*dt],[mi[j+1]],[dmi[j+1]*dt],u)[0]/dt
                          if abs(vi) > self.vmax[i]:
                              if abs(vi) > self.vmax[i]*1.001:
                                  warnings.warn("{} {} -> {} {} at u={}, dt={}".format(mi[j],dmi[j],mi[j+1],dmi[j+1],u,(ti[j+1]-ti[j])))
                                  warnings.warn("Evaluated velocity {} is larger than vmax {}".format(vi,self.vmax[i]))
                              vi = min(max(-self.vmax[i],vi),self.vmax[i])
                          break
                      j += 1
              x.append(xi)
              v.append(vi)
          return x,v
function_tokens: def predict ( self , t ) : t = t + self . trajTime x = [ ] v = [ ] for i in range ( len ( self . times ) ) : ti , mi , dmi = self . times [ i ] , self . milestones [ i ] , self . dmilestones [ i ] #evaluate trajectory j = 0 xi = mi [ - 1 ] vi = dmi [ - 1 ] if t < ti [ - 1 ] : while j + 1 < len ( ti ) : if t < ti [ j + 1 ] : assert t >= ti [ j ] dt = ( ti [ j + 1 ] - ti [ j ] ) u = ( t - ti [ j ] ) / dt xi = hermite_eval ( [ mi [ j ] ] , [ dmi [ j ] * dt ] , [ mi [ j + 1 ] ] , [ dmi [ j + 1 ] * dt ] , u ) [ 0 ] vi = hermite_deriv ( [ mi [ j ] ] , [ dmi [ j ] * dt ] , [ mi [ j + 1 ] ] , [ dmi [ j + 1 ] * dt ] , u ) [ 0 ] / dt if abs ( vi ) > self . vmax [ i ] : if abs ( vi ) > self . vmax [ i ] * 1.001 : warnings . warn ( "{} {} -> {} {} at u={}, dt={}" . format ( mi [ j ] , dmi [ j ] , mi [ j + 1 ] , dmi [ j + 1 ] , u , ( ti [ j + 1 ] - ti [ j ] ) ) ) warnings . warn ( "Evaluated velocity {} is larger than vmax {}" . format ( vi , self . vmax [ i ] ) ) vi = min ( max ( - self . vmax [ i ] , vi ) , self . vmax [ i ] ) break j += 1 x . append ( xi ) v . append ( vi ) return x , v