def main(): command = '' while command != 'q': #exit the loop by typing 'q' command = input("\nEnter bot command: ") if command != 'q': comm(command) return
def rotateR90(): track_width = 9.4 #cm d_angle = 90 dist = (d_angle / 360) * (track_width * math.pi) dist = dist * 100 #multiplied to retain two decimal points, will be divided on the Tiva side dist = int(dist) return comm('tr', dist)
def moveForward(dist): return comm('mf', dist)
def turnRight(angle_dist): return comm('tr', angle_dist)
def turnLeft(angle_dist): return comm('tl', angle_dist)
def getSensorData(): return comm('gsd')