def __init__(self, bfs, gain, trajectory, tau, add_to_goals=None, **kwargs): """ bfs int: the number of basis functions per DMP gain float: the PD gain while following a DMP trajectory trajectory np.array: the time series of points to follow [DOFs, time], with a column of None wherever the pen should be lifted tau float: the time scaling term add_to_goals np.array: floats to add to the DMP goals used to scale the DMPs spatially """ Control_OSC.__init__(self, **kwargs) self.bfs = bfs self.gain = gain self.gen_dmps(trajectory) self.tau = tau self.target,_,_ = self.dmps.step(tau=self.tau) if add_to_goals is not None: for ii, dmp in enumerate(self.dmp_sets): dmp.goal[0] += add_to_goals[ii*2] dmp.goal[1] += add_to_goals[ii*2+1] self.num_seq = 0 self.done = False self.not_at_start = True
def __init__(self, dt, gain, trajectory, **kwargs): Control_OSC.__init__(self, **kwargs) self.dt = dt self.gain = gain self.gen_trajectories(trajectory) self.target = np.array([self.y_des[0](0.0), self.y_des[1](0.0)]) self.num_seq = 0 self.time = 0.0 self.done = False self.not_at_start = True