def update( self, *args, **kwargs ): global_time.updateTime(args[0]) return self.callback(*args, **kwargs)
plane=1, pave=0, graphical=1, ground_grade=.00, robot=SpiderWHydraulics, robot_kwargs=d, render_objs=1, draw_contacts=0) last_t = 0 x_low = LowPassFilter(gain=1.0, corner_frequency=1.2) y_low = LowPassFilter(gain=1.0, corner_frequency=1.2) z_low = LowPassFilter(gain=1.0, corner_frequency=1.2) r_low = LowPassFilter(gain=1.0, corner_frequency=1.2) while True: s.step() global_time.updateTime(s.getSimTime()) if s.getSimTime() - last_t > .001: x = -(stick.get_axis(1) + .15466) if x < 0: x *= 2 x /= .7 y = -(stick.get_axis(0) + .15466) if y < 0: y *= 2 y /= .7 z = -(stick.get_axis(3) - .29895) if z < 0: z *= 2 rot = stick.get_axis(2) + .226806 x = x_low.update(x)
ground_grade=0., robot=SpiderWHydraulics, robot_kwargs=d, render_objs=1, draw_contacts=0) last_t = 0 def toScale(val): return float(val) / 128. - 1 try: while True: s.step() global_time.updateTime(s.getSimTime()) if s.getSimTime() - last_t > .001: cmd = input_server.getLastCommand() if not cmd: time.sleep(.5) continue x = toScale(cmd[18]) y = toScale(cmd[17]) z = toScale(cmd[20]) rot = toScale(cmd[19]) print x, y, z, rot s.robot.constantSpeedWalkSmart(x_scale=x, y_scale=y, z_scale=z, rot_scale=rot) last_t = s.getSimTime()
def update(self, *args, **kwargs): global_time.updateTime(args[0]) return self.callback(*args, **kwargs)