01234567890123456789012345678901234567890123456789012345678901234567890123456789
612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652 | <----SKIPPED LINES----> v = DrainQueue(q) if v: return v return {}, {}, {}, {} def ServoTestOrdinal(link): """Point laser at each of 0, 90, 180, 270 and hold for a second with different colors.""" link.Write((0, 0, *LASER_ALL)) time.sleep(1) link.Write((90, 0, *LASER_RED)) time.sleep(1) link.Write((180, 0, *LASER_GREEN)) time.sleep(1) link.Write((270, 0, *LASER_BLUE)) time.sleep(1) def ServoTestSweep(link, altitude=45): """Sweep red laser around 360 degrees.""" for azimuth in range(360, 10): link.Write((azimuth, altitude, *LASER_RED)) time.sleep(WRITE_DELAY_TIME) def ServoMain(to_arduino_q, to_parent_q, shutdown): """Main servo controller for projecting the plane position on a hemisphere. Takes the latest flight from the to_arduino_q and converts that to the current azimuth and altitude of the plane on a hemisphere. """ sys.stderr = open(messageboard.STDERR_FILE, 'a') Log('Process started with process id %d' % os.getpid()) # Ensures that the child can exit if the parent exits unexpectedly # docs.python.org/2/library/multiprocessing.html#multiprocessing.Queue.cancel_join_thread to_arduino_q.cancel_join_thread() to_parent_q.cancel_join_thread() # write_format: azimuth, altitude, R, G, & B intensity <----SKIPPED LINES----> |
01234567890123456789012345678901234567890123456789012345678901234567890123456789
612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652 | <----SKIPPED LINES----> v = DrainQueue(q) if v: return v return {}, {}, {}, {} def ServoTestOrdinal(link): """Point laser at each of 0, 90, 180, 270 and hold for a second with different colors.""" link.Write((0, 0, *LASER_ALL)) time.sleep(1) link.Write((90, 0, *LASER_RED)) time.sleep(1) link.Write((180, 0, *LASER_GREEN)) time.sleep(1) link.Write((270, 0, *LASER_BLUE)) time.sleep(1) def ServoTestSweep(link, altitude=45): """Sweep red laser around 360 degrees.""" for azimuth in range(0, 360, 10): link.Write((azimuth, altitude, *LASER_RED)) time.sleep(WRITE_DELAY_TIME) def ServoMain(to_arduino_q, to_parent_q, shutdown): """Main servo controller for projecting the plane position on a hemisphere. Takes the latest flight from the to_arduino_q and converts that to the current azimuth and altitude of the plane on a hemisphere. """ sys.stderr = open(messageboard.STDERR_FILE, 'a') Log('Process started with process id %d' % os.getpid()) # Ensures that the child can exit if the parent exits unexpectedly # docs.python.org/2/library/multiprocessing.html#multiprocessing.Queue.cancel_join_thread to_arduino_q.cancel_join_thread() to_parent_q.cancel_join_thread() # write_format: azimuth, altitude, R, G, & B intensity <----SKIPPED LINES----> |