01234567890123456789012345678901234567890123456789012345678901234567890123456789
3132333435363738394041424344454647484950515253545556575859606162636465666768697071 633634635636637638639640641642643644645646647648649650651652 653654655656657658659660661662663664665666667668669670671672 | <----SKIPPED LINES----> REMOTE_SIMULATED_IN = 'remote_in.txt' REMOTE_SIMULATED_OUT = 'remote_out.txt' if RASPBERRY_PI: ARDUINO_LOG = MESSAGEBOARD_PATH + ARDUINO_LOG SERIALS_LOG = MESSAGEBOARD_PATH + SERIALS_LOG SERVO_SIMULATED_OUT = MESSAGEBOARD_PATH + SERVO_SIMULATED_OUT SERVO_SIMULATED_IN = MESSAGEBOARD_PATH + SERVO_SIMULATED_IN REMOTE_SIMULATED_OUT = MESSAGEBOARD_PATH + REMOTE_SIMULATED_OUT REMOTE_SIMULATED_IN = MESSAGEBOARD_PATH + REMOTE_SIMULATED_IN ARDUINO_ROLLING_LOG = WEBSERVER_PATH + ARDUINO_ROLLING_LOG CONNECTION_FLAG_BLUETOOTH = 1 CONNECTION_FLAG_USB = 2 CONNECTION_FLAG_SIMULATED = 3 RASPBERRY_PI = psutil.sys.platform.title() == 'Linux' SN_SERVO = '5583834303435111C1A0' SERVO_CONNECTION = (CONNECTION_FLAG_BLUETOOTH, (2, '98:D3:11:FC:42:16', 1)) # with MOSFET SERVO_CONNECTION = (CONNECTION_FLAG_BLUETOOTH, (3, '98:D3:91:FD:B1:8F', 1)) # no MOSFET SN_REMOTE = '75835343130351802272' # directly connected to Serial2 # connected thru MOSFET to Serial1 REMOTE_CONNECTION = (CONNECTION_FLAG_BLUETOOTH, (1, '98:D3:91:FD:B3:C9', 1)) MIN_ALTITUDE = 5 # below this elevation degrees, turn off the tracking if SIMULATE_ARDUINO: SERVO_CONNECTION = (CONNECTION_FLAG_SIMULATED, (SERVO_SIMULATED_IN, SERVO_SIMULATED_OUT)) REMOTE_CONNECTION = ( CONNECTION_FLAG_SIMULATED, (REMOTE_SIMULATED_IN, REMOTE_SIMULATED_OUT)) KEY_NOT_PRESENT_STRING = 'N/A' DISP_LAST_FLIGHT_NUMB_ORIG_DEST = 0 DISP_LAST_FLIGHT_AZIMUTH_ELEVATION = 1 DISP_FLIGHT_COUNT_LAST_SEEN = 2 DISP_RADIO_RANGE = 3 DISPLAY_MODE_NAMES = [ <----SKIPPED LINES----> flight, json_desc_dict, configuration, additional_attr = InitialMessageValues( to_arduino_q) next_read = 0 next_write = 0 now = GetNow(json_desc_dict, additional_attr) while not shutdown.value: if not to_arduino_q.empty(): flight, json_desc_dict, configuration, additional_attr = to_arduino_q.get( block=False) if 'test_servos' in configuration: messageboard.RemoveSetting(configuration, 'test_servos') link.Write((0, 0, *LASER_RGB_OFF)) time.sleep(1) link.Write((90, 0, *LASER_RGB_OFF)) time.sleep(1) link.Write((180, 0, *LASER_RGB_OFF)) time.sleep(1) link.Write((270, 0, *LASER_RGB_OFF)) new_flight = DifferentFlights(flight, last_flight) if new_flight: Log('Flight changed from %s to %s' % ( messageboard.DisplayFlightNumber(last_flight), messageboard.DisplayFlightNumber(flight) ), ser=link) # Turn off laser so that line isn't traced while it moves to new position link.Write((*last_angles, *LASER_RGB_OFF)) last_flight = flight if time.time() >= next_read: heartbeat = link.Read() # simple ack message sent by servos next_read = time.time() + READ_DELAY_TIME if heartbeat and VERBOSE: Log(heartbeat) now = GetNow(json_desc_dict, additional_attr) <----SKIPPED LINES----> |
01234567890123456789012345678901234567890123456789012345678901234567890123456789
3132333435363738394041424344454647484950515253545556575859606162636465666768697071 633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673 | <----SKIPPED LINES----> REMOTE_SIMULATED_IN = 'remote_in.txt' REMOTE_SIMULATED_OUT = 'remote_out.txt' if RASPBERRY_PI: ARDUINO_LOG = MESSAGEBOARD_PATH + ARDUINO_LOG SERIALS_LOG = MESSAGEBOARD_PATH + SERIALS_LOG SERVO_SIMULATED_OUT = MESSAGEBOARD_PATH + SERVO_SIMULATED_OUT SERVO_SIMULATED_IN = MESSAGEBOARD_PATH + SERVO_SIMULATED_IN REMOTE_SIMULATED_OUT = MESSAGEBOARD_PATH + REMOTE_SIMULATED_OUT REMOTE_SIMULATED_IN = MESSAGEBOARD_PATH + REMOTE_SIMULATED_IN ARDUINO_ROLLING_LOG = WEBSERVER_PATH + ARDUINO_ROLLING_LOG CONNECTION_FLAG_BLUETOOTH = 1 CONNECTION_FLAG_USB = 2 CONNECTION_FLAG_SIMULATED = 3 RASPBERRY_PI = psutil.sys.platform.title() == 'Linux' SN_SERVO = '5583834303435111C1A0' SERVO_CONNECTION = (CONNECTION_FLAG_BLUETOOTH, (2, '98:D3:11:FC:42:16', 1)) # with MOSFET #SERVO_CONNECTION = (CONNECTION_FLAG_BLUETOOTH, (3, '98:D3:91:FD:B1:8F', 1)) # no MOSFET SN_REMOTE = '75835343130351802272' # directly connected to Serial2 # connected thru MOSFET to Serial1 REMOTE_CONNECTION = (CONNECTION_FLAG_BLUETOOTH, (1, '98:D3:91:FD:B3:C9', 1)) MIN_ALTITUDE = 5 # below this elevation degrees, turn off the tracking if SIMULATE_ARDUINO: SERVO_CONNECTION = (CONNECTION_FLAG_SIMULATED, (SERVO_SIMULATED_IN, SERVO_SIMULATED_OUT)) REMOTE_CONNECTION = ( CONNECTION_FLAG_SIMULATED, (REMOTE_SIMULATED_IN, REMOTE_SIMULATED_OUT)) KEY_NOT_PRESENT_STRING = 'N/A' DISP_LAST_FLIGHT_NUMB_ORIG_DEST = 0 DISP_LAST_FLIGHT_AZIMUTH_ELEVATION = 1 DISP_FLIGHT_COUNT_LAST_SEEN = 2 DISP_RADIO_RANGE = 3 DISPLAY_MODE_NAMES = [ <----SKIPPED LINES----> flight, json_desc_dict, configuration, additional_attr = InitialMessageValues( to_arduino_q) next_read = 0 next_write = 0 now = GetNow(json_desc_dict, additional_attr) while not shutdown.value: if not to_arduino_q.empty(): flight, json_desc_dict, configuration, additional_attr = to_arduino_q.get( block=False) if 'test_servos' in configuration: messageboard.RemoveSetting(configuration, 'test_servos') link.Write((0, 0, *LASER_RGB_OFF)) time.sleep(1) link.Write((90, 0, *LASER_RGB_OFF)) time.sleep(1) link.Write((180, 0, *LASER_RGB_OFF)) time.sleep(1) link.Write((270, 0, *LASER_RGB_OFF)) time.sleep(1) new_flight = DifferentFlights(flight, last_flight) if new_flight: Log('Flight changed from %s to %s' % ( messageboard.DisplayFlightNumber(last_flight), messageboard.DisplayFlightNumber(flight) ), ser=link) # Turn off laser so that line isn't traced while it moves to new position link.Write((*last_angles, *LASER_RGB_OFF)) last_flight = flight if time.time() >= next_read: heartbeat = link.Read() # simple ack message sent by servos next_read = time.time() + READ_DELAY_TIME if heartbeat and VERBOSE: Log(heartbeat) now = GetNow(json_desc_dict, additional_attr) <----SKIPPED LINES----> |