Changes between Version 3 and Version 4 of Tutorial5AdvancedRemoteControlUsage


Ignore:
Timestamp:
Nov 22, 2017, 11:22:07 AM (8 years ago)
Author:
fma
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Tutorial5AdvancedRemoteControlUsage

    v3 v4  
    33== Introduction ==
    44
    5 As we've seen in [[Tutorial1FirstRobot|tutorial 1]], we created a '''{{{Gamepad}}}''' class in order to control our robot. This class inherits from '''{{{RemoteControl}}}''', and implements a few virtual methods:
     5As we've seen in [[Tutorial1FirstRobot|tutorial 1]], we created a {{{Gamepad}}} class in order to control our robot. This class inherits from {{{RemoteControl}}}, and implements a few virtual methods:
    66
    77{{{
     
    2828}}}
    2929
    30 The first method, '''{{{_createFrontend()}}}''' must return a valid frontend (we just saw in [[Tutorial4AddInputFrontendSupport|previous tutorial]] how to create such frontends). This methods takes as first argument the frontend path in '''{{{/dev}}}'''. An additional argument can be given to override the '''{{{DEFAULT_AXIS_CALIBRATION}}}''' table.
     30The first method, {{{_createFrontend()}}} must return a valid frontend (we just saw in [[Tutorial4AddInputFrontendSupport|previous tutorial]] how to create such frontends). This methods takes as first argument the frontend path in '''{{{/dev}}}'''. An additional argument can be given to override the {{{DEFAULT_AXIS_CALIBRATION}}} table.
    3131
    32 The second method, '''{{{_buildComponents()}}}''' is where interesting things take place. Here, we create the buttons/axis mapping to the robot controls.
     32The second method, {{{_buildComponents()}}} is where interesting things take place. Here, we create the buttons/axis mapping to the robot controls.
    3333
    3434== Components ==
     
    3636'''Py4bot''' implements different components to build a custom remote control mapping:
    3737
    38 === '''{{{Button}}}''' ===
     38=== {{{Button}}} ===
    3939
    4040This is a simple push button, whith several ''triggers'', in order to control its behavior:
     
    4949Default trigger is ''click'' (you must press and release the button quickly).
    5050
    51 === '''{{{Switch}}}''' ===
     51=== {{{Switch}}} ===
    5252
    5353This is a button toggling between 2 states when you press it.
    5454
    55 === '''{{{Analog}}}''' ===
     55=== {{{Analog}}} ===
    5656
    5757This component handles a single analog axis.
    5858
    59 === '''{{{Joystick}}}''' ===
     59=== {{{Joystick}}} ===
    6060
    61 Combines several '''{{{Analog}}}''' axis.
     61Combines several {{{Analog}}} axes.
    6262
    6363== Configurations and modifiers ==
     
    6565There are many commands to control the robot, and not enough physical buttons/axis on a gamepad. So, a solution is to multiplex these buttons/axis. There are 2 ways to do that: ''configurations'' and ''modifiers''. ''configurations'' allow us to change the entire mapping; ''modifiers'' only changes a button meaning.
    6666
    67 To create several ''configurations'', we use the '''{{{_addConfig()}}}''' method. This method take a string as argument, the name of the config. In our example, we created 2 ''configurations'', one to dynamically control the robot (make it walk), the other one to statically control the robot (move the body).
     67To create several ''configurations'', we use the {{{_addConfig()}}} method. This method take a string as argument, the name of the config. In our example, we created 2 ''configurations'', one to dynamically control the robot (make it walk), the other one to statically control the robot (move the body).
    6868