def drive_vel_cmd_callback(channel, msg): # set the odrive's velocity to the float specified in the message # no state change global speed_lock, odrive_bridge try: cmd = DriveVelCmd.decode(msg) if (odrive_bridge.get_state_string() == "ArmedState"): global left_speed, right_speed speed_lock.acquire() left_speed, right_speed = cmd.left, cmd.right speed_lock.release() except Exception: pass
def drive_vel_cmd_callback(channel, msg): # set the odrive's velocity to the float specified in the message # no state change global speedlock global odrive_bridge try: cmd = DriveVelCmd.decode(msg) if (odrive_bridge.get_state() == "ArmedState"): global left_speed global right_speed speedlock.acquire() left_speed = cmd.left right_speed = cmd.right speedlock.release() except NameError: print("waiting to find odrive")