Files
paparazzi/conf/joystick/nes_gamepad.xml
T
Gautier Hattenberger 363dec8693 Autopilot refactor (#2009)
* [autopilot] refactor autopilot API for both firmwares

With this, fixedwing and rotorcraft are mostly using the same interface
for the autopilot. Some specific code and messages handling are still
firmware dependent.
A large part of the autopilot logic of the fixedwing is moved from
main_ap to autopilot_static.
More getter/setter functions are provided.

* [autopilot] update the rest of the system and the conf

for using the refactored autopilot API

* [autopilot] fix some errors from CI servers

* [actuators] use dummy actuators module to prevent autoloading

* Rename Bart_heliDD_INDI.xml to tudelft_bs_helidd_indi.xml

* Rename Bart_heliDD_pid.xml to tudelft_bs_helidd_pid.xml

* Delete tudelft_course2016_bebop_colorfilter.xml

* Delete tudelft_course2016_bebop_avoider.xml

* [actuators] don't autoload actuators when set to 'none'

* [gcs] autodetect firmware for strip mode button
2017-02-19 11:45:57 +01:00

122 lines
3.9 KiB
XML

<!-- NES gamepad
Support for NAV/GUIDED mode flight using NES and NES-clones that comply to the following axes/button mappings.
| |
________________|_|__________________________________
| _________________________________________________ |
| | |_____________| | |
| | ___ ,-------------. | |
| | | | |_____________| Nintendo | |
| | ___| |___ ,-------------. | |
| | | ,-. | |SELECT START| ___B ___A | |
| | |___ `-' ___| ;=============` |,-.| |,-.| | |
| | | | | === === | |._,| |._,| | |
| | |___| ;=============. '---' '---' | |
| |_________________|_____________|_________________| |
|_____________________________________________________|
AXES - 2 axes: (black)
axis 0: Roll - Left/Right range:(-127..126); center:(-1)
axis 1: Pitch - Forward/Back range:(-127..126); center:(-1)
BUTTONS - 11 buttons of which only 4 are used:
b0 - A (red) values:(0 | 1)
b1 - B (red) values:(0 | 1)
b8 - select (black) values:(0 | 1)
b9 - start (black) values:(0 | 1)
TEST STICK DATA OUTPUT:
$ ./sw/ground_segment/joystick/test_stick
Available button: 11 (0xb)
Available hats: 0 (0x0)
Available axes: 2 (0x2)
Axis 0 : parameters = [-32768,32768]
Axis 1 : parameters = [-32768,32768]
Input device name: "2Axes 11Keys Game Pad" on SDL device "0"
buttons 0 0 0 0 0 0 0 0 0 0 0 | hat 0 | axes -1 -1
buttons 0 0 0 0 0 0 0 0 0 0 0 | hat 0 | axes -1 -1
buttons 0 0 0 0 0 0 0 0 0 0 0 | hat 0 | axes -1 -1
...
-->
<joystick>
<input>
<axis index="0" name="roll" trim="1.0"/>
<axis index="1" name="pitch" trim="1.0"/>
<button index="0" name="A"/>
<button index="1" name="B"/>
<button index="8" name="select"/>
<button index="9" name="start"/>
</input>
<variables>
<!-- TBD: NOT USED AT THIS POINT -->
<var name="mode" default="2"/>
</variables>
<messages period="0.05">
<!-- Move at Body Velocity : forward/right/down/yaw -->
<message class="datalink" name="GUIDED_SETPOINT_NED" send_always="true">
<field name="flags" value="226"/> <!-- 0xE2 -->
<field name="x" value="Fit(pitch,-100,100,-127,127)"/>
<field name="y" value="Fit(-roll,-100,100,-127,127)"/>
<field name="z" value="0 - A + B"/>
<field name="yaw" value="0 + start - select"/>
</message>
<!-- Set NAV Mode -->
<message class="ground" name="DL_SETTING" on_event="select && A">
<field name="index" value="IndexOfSetting('autopilot_mode_auto2')"/>
<field name="value" value="13"/>
</message>
<!-- Set GUIDED Mode -->
<message class="ground" name="DL_SETTING" on_event="select && B">
<field name="index" value="IndexOfSetting('autopilot_mode_auto2')"/>
<field name="value" value="19"/>
</message>
<!-- go to "Start Engine" block if in AUTO2/NAV -->
<message class="ground" name="JUMP_TO_BLOCK" on_event="start && A">
<field name="block_id" value="IndexOfBlock('Start Motors')"/>
</message>
<!-- go to "Takeoff" block if in AUTO2/NAV -->
<message class="ground" name="JUMP_TO_BLOCK" on_event="start && B">
<field name="block_id" value="IndexOfBlock('Takeoff')"/>
</message>
<!-- go to "land here" block if in AUTO2/NAV -->
<message class="ground" name="JUMP_TO_BLOCK" on_event="A && B">
<field name="block_id" value="IndexOfBlock('land')"/>
</message>
<!-- Set "autopilot.kill_throttle" in AUTO2/NAV -->
<message class="ground" name="DL_SETTING" on_event="select && start">
<field name="index" value="IndexOfSetting(autopilot.kill_throttle)"/>
<field name="value" value="2"/>
</message>
</messages>
</joystick>