Changes between Version 91 and Version 92 of UserGuideGit


Ignore:
Timestamp:
Nov 23, 2017, 9:30:21 AM (8 years ago)
Author:
fma
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UserGuideGit

    v91 v92  
    185185* {{{_buildComponents(self)}}}
    186186
    187 Here, we create the components of the remote control
    188 
    189 The following methods are used to setup the remote control:
     187Here, we create the components of the remote control.
     188
     189A number of helper methods are used to setup the remote control:
    190190
    191191 * {{{_addConfig(self, config)}}}
     192  * '''config''': str ot list/tuple of str, containing the name of the config(s).
     193
    192194 * {{{_addComponent(self, cls, **kwargs)}}}
    193 
    194 (See below)
    195 
    196 Then, a number of objects/methods can be used as components commands:
     195  * '''cls''' is the {{{Component}}} class to instantiate. For now, {{{Button}}}, {{{Switch}}}, {{{Analog}}} or {{{Joystick}}};
     196  * '''configs''' (optional) contains the config(s) where this {{{Component}}} will be valid. Several configs can be given has list/tuple. By default, the {{{Component}}} will be valid in all configs;
     197  * '''command''' is a Python callable (function, method...) which can be reached from our class. You may remember that we gave the robot instance when instantiating the gamepad object; this way, we can refer to all robot methods through {{{self.robot}}}. We can directly reach {{{GaitSequencer}}} as it is a singleton;
     198  * '''key'''/'''keys'''  is the input {{{Frontend}}} key to associate with the {{{Component}}}. There are 2 types of keys: ''button_'' and ''analog_'';
     199  * '''modifier''' (optional) is a key (must be a ''button_'' type) which must be pressed together with the main '''key''' to trigger the '''command''';
     200  * '''mapper''' is a {{{Mapper}}}s, another Python callable which translates {{{RemoteControl}}} {{{Component}}} output to '''command''' input.
    197201
    198202 * {{{selectPreviousConfig(self)}}}
     203
    199204 * {{{selectNextConfig(self)}}}
     205
    200206 * {{{robot}}}
    201207
    202 The {{{robot}}} object is used to reach the robot methods from the components.
     208The {{{robot}}} object is used to reach the robot methods from the {{{component}}}s.
    203209
    204210=== Component ===