Changes between Version 33 and Version 34 of Tutorials


Ignore:
Timestamp:
Mar 31, 2016, 8:23:34 AM (10 years ago)
Author:
fma
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials

    v33 v34  
    427427and 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.
    428428
    429 Let's modify our {{{Hexapod}}} class:
     429Here is the new {{{Hexapod}}} class:
    430430
    431431{{{
     
    467467}}}
    468468
    469 In addition, we must add a few things in the '''{{{settings.py}}}''' module:
    470 
    471 {{{
    472 #!python
     469In addition, we must modify/add a few things in the '''{{{settings.py}}}''' module:
     470
     471{{{
     472#!python
     473
     474# Legs / servos mapping
     475LEGS_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}
    473483
    474484SERVOS_CALIBRATION = {
     
    499509}}}
    500510
    501 {{{SERVOS_CALIBRATION}}} dict contains:
     511=== Settings ===
     512
     513In this tutorial, we just renamed {{{LEGS_ACTUATOR_MAPPING}}} to {{{LEGS_SERVOS_MAPPING}}}, and added the {{{SERVOS_CALIBRATION}}} dict, which contains:
    502514
    503515* {{{offset}}} is the angle between the servo reference and the real angle. See the [[FAQ#Howisgeometrydefined|FAQ]] for the real angles definition;
     
    510522
    511523
    512 
    513 
    514 
    515 
    516524We 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.
    517525