Changeset 42 for remote_control
- Timestamp:
- 05/18/10 03:42:20 (12 years ago)
- Location:
- remote_control
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
remote_control/puzzlebox_brainstorms_client_interface.py
r31 r42 9 9 # For more information please refer to http://www.gnu.org/copyleft/gpl.html 10 10 # 11 # Last Update: 2010.0 2.0411 # Last Update: 2010.05.03 12 12 # 13 13 ##################################################################### … … 35 35 36 36 FLIP = 1 37 38 DISCRETE_CONTROL_COMMANDS = configuration.DISCRETE_CONTROL_COMMANDS 37 39 38 40 SERVER_HOST = configuration.SERVER_HOST … … 87 89 self.screen = None 88 90 self.FLIP = FLIP 91 self.DISCRETE_CONTROL_COMMANDS = DISCRETE_CONTROL_COMMANDS 89 92 self.image_directory = IMAGE_DIRECTORY 90 93 -
remote_control/puzzlebox_brainstorms_configuration.py
r31 r42 9 9 # For more information please refer to http://www.gnu.org/copyleft/gpl.html 10 10 # 11 # Last Update: 2010.0 2.0311 # Last Update: 2010.05.03 12 12 # 13 13 ##################################################################### … … 21 21 22 22 DEBUG = 1 23 24 DISCRETE_CONTROL_COMMANDS = False 23 25 24 26 ##################################################################### … … 50 52 51 53 SERVER_INTERFACE = '' # listen on all of server's network interfaces 52 SERVER_HOST = '192.168.1.150' 54 #SERVER_HOST = '192.168.1.150' 55 SERVER_HOST = '127.0.0.1' # localhost 53 56 SERVER_PORT = 8194 54 57 -
remote_control/puzzlebox_brainstorms_remote_control.py
r40 r42 9 9 # For more information please refer to http://www.gnu.org/copyleft/gpl.html 10 10 # 11 # Last Update: 2010.0 2.0511 # Last Update: 2010.05.03 12 12 # 13 13 ##################################################################### … … 26 26 27 27 DEBUG = 2 28 29 DISCRETE_CONTROL_COMMANDS = configuration.DISCRETE_CONTROL_COMMANDS 28 30 29 31 BLUETOOTH_DEVICE = configuration.BLUETOOTH_DEVICE … … 155 157 156 158 # Continue operating motors while control program pauses 157 time.sleep(duration) 159 if DISCRETE_CONTROL_COMMANDS: 160 time.sleep(duration) 161 162 self.stop_motors(connection) 163 164 165 ################################################################## 166 167 def stop_motors(self, connection): 168 169 "Stop both motors" 170 171 left_motor = self.connect_to_port(MOTOR_PORT_LEFT) 172 right_motor = self.connect_to_port(MOTOR_PORT_RIGHT) 158 173 159 174 # Issue command to stop both motors … … 266 281 def run(self, command): 267 282 268 if (command == 'test_drive'): 269 self.test_drive(self.connection) 270 271 elif (command == 'drive_forward'): 283 if (command == 'drive_forward'): 272 284 self.drive_forward(self.connection, duration=3) 273 285 … … 286 298 elif (command == 'turn_right_in_reverse'): 287 299 self.turn_right_in_reverse(self.connection) 300 301 elif (command == 'stop_motors'): 302 self.stop_motors(self.connection) 303 304 elif (command == 'test_drive'): 305 self.test_drive(self.connection) 288 306 289 307 -
remote_control/puzzlebox_brainstorms_server.py
r36 r42 9 9 # For more information please refer to http://www.gnu.org/copyleft/gpl.html 10 10 # 11 # Last Update: 2010.0 2.0511 # Last Update: 2010.05.03 12 12 # 13 13 ##################################################################### … … 27 27 28 28 DEBUG = 1 29 30 DISCRETE_CONTROL_COMMANDS = configuration.DISCRETE_CONTROL_COMMANDS 29 31 30 32 SERVER_INTERFACE = configuration.SERVER_INTERFACE … … 57 59 58 60 59 command_line = 'python puzzlebox_brainstorms_remote_control.py --command=%s' % command 60 61 os.system(command_line) 61 if DISCRETE_CONTROL_COMMANDS: 62 63 command_line = 'python puzzlebox_brainstorms_remote_control.py --command=%s' % command 64 65 os.system(command_line) 62 66 63 67
Note: See TracChangeset
for help on using the changeset viewer.