Virtual Reality Toolbox    
Joystick Input

Asynchronous joystick input

Library

Virtual Reality Toolbox

Description

The Joystick Input block provides a convenient interaction between a Simulink model and the virtual world associated with a Virtual Reality Toolbox block. It works only on Windows operating systems.

The Joystick Input block uses axes, buttons and, if present, the point-of-view selector. You can use this block as you would use any other Simulink source block. Its output ports reflect the status of the joystick controls for axes and buttons.

Block Parameters Dialog Box

Joystick ID -- The system ID assigned to the given joystick device. You can find the properties of the joystick connected to the system in the Game Controllers section of the system Control Panel.

Adjust output ports according to joystick capabilities -- If you select this check box, the output ports do not have the full width provided by the Windows Game Controllers interface. Instead, the Virtual Reality Toolbox dynamically adjusts the output ports to correspond to the capabilities of the connected joystick each time the model is opened.

Output Ports -- Depending on the check box setting previously described, output ports either have fixed maximum width provided by the system Game Controllers interface or the output ports change to correspond to the actual capabilities of the connected joystick.

Output Port
Value
Description
Axes
Vector of doubles
in the range < -1; 1 >
Outputs correspond to the current position of the joystick in the given axis. Values are normalized to the range from -1 to 1.
Buttons
Vector of doubles

0 -- Button released
1 -- Button pressed
Outputs correspond to the current status of joystick buttons.
Point of view

-1 -- selector inactive
<0;360) -- the angle of the POV selector, in degrees
Output corresponds to the current status of the joystick Point of View selector.


  Block Reference Magellan SpaceMouse