Changeset 8 for rc/puzzlebox_brainstorms_rc.py
- Timestamp:
- 01/28/10 16:05:08 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rc/puzzlebox_brainstorms_rc.py
r7 r8 160 160 ################################################################## 161 161 162 def drive_forward(self, connection, power=80, duration= 3):162 def drive_forward(self, connection, power=80, duration=2): 163 163 164 164 "Drive the robot forward at a certain speed for a certain duration" 165 166 self.drive(connection, power, power, duration) 167 168 169 ################################################################## 170 171 def drive_reverse(self, connection, power=80, duration=2): 172 173 "Drive the robot reverse at a certain speed for a certain duration" 174 175 power = -power 165 176 166 177 self.drive(connection, power, power, duration) … … 182 193 ################################################################## 183 194 184 def turn_left(self, connection, power=80, duration= 3):195 def turn_left(self, connection, power=80, duration=2): 185 196 186 197 "Turn the robot counter-clockwise at a" … … 195 206 ################################################################## 196 207 197 def turn_right(self, connection, power=80, duration= 3):208 def turn_right(self, connection, power=80, duration=2): 198 209 199 210 "Turn the robot counter-clockwise at a" … … 201 212 202 213 left_power = power 203 right_power = - power214 right_power = -(power/2) 204 215 205 216 self.drive(connection, left_power, right_power, duration) … … 240 251 self.drive_forward(self.connection) 241 252 253 elif (command == 'drive_reverse'): 254 self.drive_reverse(self.connection) 255 242 256 elif (command == 'turn_in_reverse'): 243 257 self.turn_in_reverse(self.connection) … … 270 284 # Collect default settings and command line parameters 271 285 device = BLUETOOTH_DEVICE 286 command = DEFAULT_RC_COMMAND 272 287 273 288 for each in sys.argv: … … 276 291 device = each[ len("--device="): ] 277 292 elif each.startswith("--command="): 278 device= each[ len("--command="): ]293 command = each[ len("--command="): ] 279 294 280 295
Note: See TracChangeset
for help on using the changeset viewer.