def main(args): bbbl = christine_hwi_ext.BBBLink() bbbl.init() #pass_dsm(bbbl) #steering_sin(bbbl) #throttle_sin(bbbl) throttle_sin(bbbl, b=0.0, a=60.)
def main(): use_bbbl = True if not use_bbbl: od = odrive_ascii_cpp_ext.Odrive() od.init() bbbl = None else: bbbl = christine_hwi_ext.BBBLink() bbbl.init() od = None measure(od, bbbl, nb_rev=1.)
def measure(filename='/tmp/foo.npz'): bbbl = christine_hwi_ext.BBBLink() bbbl.init() dt, n_samples = 0.02, 500 _time, throttle, mot_vel = np.zeros(n_samples), np.zeros( n_samples), np.zeros(n_samples) for i in range(n_samples): _start = _time[i] = time.time() steering, throttle[i] = 0, 0.06 + 0.01 * np.sin(0.9 * time.time()) bbbl.send(steering, throttle[i]) mot_pos, mot_vel[i] = bbbl.get_motor() _end = time.time() elapsed = _end - _start time_to_sleep = dt - elapsed if time_to_sleep > 0: time.sleep(time_to_sleep) np.savez(filename, time=_time, throttle=throttle, mot_vel=mot_vel) return time, throttle, mot_vel
def main(): bbbl = christine_hwi_ext.BBBLink() bbbl.init() drive(bbbl, vel_cps=60, R=0.75)
def __init__(self): self.bbbl = christine_hwi_ext.BBBLink() self.bbbl.init() self.robot_listener = tdgru.SmocapListener() self.time, self.inputs, self.mot, self.pos, self.yaw = [], [], [], [], []