Joystick emulation
OpenTX on Taranis/Horus radios can act as a USB Joystick when connected to a personal computer.
How to activate
Ensure that cli and massstorage options are not used
Power up Taranis (do not activate Bootloader)
Clear all warnings
Connect USB cable, USB connect symbol appears.
USB Joystick device should be available on computer.
Description of Joystick interface
Taranis simulates a joystick device with:
8 analog axes
24 digital buttons
Analog axes are mapped to first eight channels: from CH1 to CH8. Valid output value for each channel is from -100 to 100.
Buttons are mapped to the remaining channels: form CH9 to CH32. Button is considered pressed when channel value is bigger than zero.
User should create a new model for joystick usage with following settings:
TX module turned off
servo limits at 100%
appropriate mixes on channels 1 to 32
optionally some exponential on analog axes (channels 1 - 8)
Example model setup
TODO
Technical details
Tranis simulates 8bit analog USB joystick. Channel outputs in range from -100% to 100% are mapped into 8 bit signed number from -127 to 127. Channel values higher than 100% or lower than -100% are truncated into 100% and -100% respectively.
Using Taranis USB Joystick with CRRCsim on Linux
This setup describes how to compile and configure CRRCsim 0.9.112 flying simulator on Linux Mint 15 Olivia (based on Ubuntu Raring 13.04).
Installation of CRRCsim
Start by downloading CRRCsim 0.9.112 source from source
Before compilation we nedd to install needed packages (might need some more, that I installed before, look at output of ./configure for clues):
I choose not to install CRRCsim ($ sudo make install
) and choose to run it from build directory.
Joystick calibration
Joystick calibratin on linux with jscal
creates a small deadzone (deadband) around stick centres by default. Deadband means that small stick movements around centre position result in no movement on computer. This is undesirable for usage in RC simulators. Folowing steps are necessary to get reed of deadband.
First you calibrate joystick with jscal you get a calibration string like so:
Get the calibration string with this command:
The deadzone is defined by first two numbers, for example last channel:
Here the deadzone is from -5 to -4. We want this to be 0, 0 on all channels. We must edit string that was returned by jscal -p command. Just set two numbers that precede two large numbers to 0, 0:
Original:
Changed:
Save this for later. You must do this procedure for your setup, don't use my numbers!
Calibration testing
First set calibration, use above (version with your calibration values)
Then run test:
The values should change with the slightest movement of stick around center position. If they stay zero, then you set wrong calibration parameters.
Setting up CRRCsim
CRRCsim uses SDL interface to access joystick, by default SDL ignores joystick calibration that was set with jscal. To correct that, the environment variable SDL_JOYSTICK_DEVICE
must be set (explanation). It is best to use a short script, that will set joystick calibration, export variable and run CRRCsim. Be sure to use you own calibration values inside the script:
Last updated