Changes between Version 33 and Version 34 of Tutorials
- Timestamp:
- Mar 31, 2016, 8:23:34 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Tutorials
v33 v34 427 427 and let's say you want to use a [http://www.dfrobot.com/wiki/index.php/Veyron_Servo_Driver_(24-Channel)_(SKU:DRI0029) Veyron servos driver] as low-level hardware driver. 428 428 429 Let's modify our{{{Hexapod}}} class:429 Here is the new {{{Hexapod}}} class: 430 430 431 431 {{{ … … 467 467 }}} 468 468 469 In addition, we must add a few things in the '''{{{settings.py}}}''' module: 470 471 {{{ 472 #!python 469 In addition, we must modify/add a few things in the '''{{{settings.py}}}''' module: 470 471 {{{ 472 #!python 473 474 # Legs / servos mapping 475 LEGS_SERVOS_MAPPING = { 476 'RF': {'coxa': 0, 'femur': 1, 'tibia': 2}, 477 'RM': {'coxa': 4, 'femur': 5, 'tibia': 6}, 478 'RR': {'coxa': 8, 'femur': 9, 'tibia': 10}, 479 'LR': {'coxa': 15, 'femur': 14, 'tibia': 13}, 480 'LM': {'coxa': 19, 'femur': 18, 'tibia': 17}, 481 'LF': {'coxa': 23, 'femur': 22, 'tibia': 21} 482 } 473 483 474 484 SERVOS_CALIBRATION = { … … 499 509 }}} 500 510 501 {{{SERVOS_CALIBRATION}}} dict contains: 511 === Settings === 512 513 In this tutorial, we just renamed {{{LEGS_ACTUATOR_MAPPING}}} to {{{LEGS_SERVOS_MAPPING}}}, and added the {{{SERVOS_CALIBRATION}}} dict, which contains: 502 514 503 515 * {{{offset}}} is the angle between the servo reference and the real angle. See the [[FAQ#Howisgeometrydefined|FAQ]] for the real angles definition; … … 510 522 511 523 512 513 514 515 516 524 We need to create our remote control, in order to drive our simulated robot. for this example, let's use an old gamepad, a [http://www.thrustmaster.com/en_IN/products/firestorm-dual-analog-3 Thrustmaster Firestorm Dual Analog 3]. As I own such gamepad, I already added support in Py4bot. 517 525
