Changes between Version 93 and Version 94 of UserGuideGit
- Timestamp:
- Nov 23, 2017, 3:31:41 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UserGuideGit
v93 v94 175 175 [[Image(design_remote-control.png, 300px)]] 176 176 177 As you can see on the UML diagram, a {{{RemoteControl}}} object uses {{{Components}}}; a {{{Component}}} can be a {{{Button}}}, a {{{Switch}}} an {{{A nalog}}}, or a {{{Joystick}}}.177 As you can see on the UML diagram, a {{{RemoteControl}}} object uses {{{Components}}}; a {{{Component}}} can be a {{{Button}}}, a {{{Switch}}} an {{{Axis}}}, or a {{{Joystick}}}. 178 178 179 179 {{{RemoteControl}}} has the following virtual methods which must be override in a custom remote control class: … … 193 193 194 194 * {{{_addComponent(self, cls, **kwargs)}}} 195 * '''cls''' is the {{{Component}}} class to instantiate. For now, {{{Button}}}, {{{Switch}}}, {{{A nalog}}} or {{{Joystick}}};195 * '''cls''' is the {{{Component}}} class to instantiate. For now, {{{Button}}}, {{{Switch}}}, {{{Axis}}} or {{{Joystick}}}; 196 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 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 198 * '''key'''/'''keys''' is the input {{{Frontend}}} key to associate with the {{{Component}}}. There are 2 types of keys: ''button_'' and ''analog_''; 199 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 * '''curve''' response {{{Curve}}} of the input - for {{{Analog}}}/{{{Joystick}}} only; 200 * '''threshold''' is the value {{{Axis}}}/{{{Joystick}}} have to change to trigger; 201 * '''curve''' response {{{Curve}}} of the input - for {{{Axis}}}/{{{Joystick}}} only; 201 202 * '''mapper''' is a {{{Mapper}}}s, another Python callable which translates {{{RemoteControl}}} {{{Component}}} output to '''command''' input. 202 203 … … 230 231 {{{Switch}}} is a button toggling between 2 states when you press it. 231 232 232 ==== A nalog====233 234 {{{A nalog}}} handles a single analog axis.233 ==== Axis ==== 234 235 {{{Axis}}} handles a single analog axis. 235 236 236 237 ==== Joystick ==== 237 238 238 {{{Joystick}}} combines several {{{Analog}}}axes.239 {{{Joystick}}} combines several analog axes. 239 240 240 241 === Configurations and modifiers ===
