Process input from asynchronous joystick device
Simulink 3D Animation
The Joystick Input block provides interaction between a Simulink® model and the virtual world associated with a Simulink 3D Animation™ block.
The Joystick Input block uses axes, buttons, and the point-of-view selector, if present. 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.
The Joystick Input block also supports force-feedback devices.
Force — Force feedback input
Provide the force-feedback to be applied along supported joystick axes.
The length of the Force vector corresponds to the number of joystick axes that support force-feedback.
To enable this port, you must first select the Enable force-feedback input parameter.
Axes — Joystick position along any given axis
vector with each element in the range [-1,1]
The first joystick axes element is
x, the second
y, and so on up to the total number of
axes. What the
x axis represents depends on the type
and shape of the joystick. The Joystick Input block uses
the mapping between the joystick driver and the joystick.
Buttons — Status of joystick buttons
vector of 0 and 1
Point of view — Current status of the joystick point-of-view selector
-1 (selector inactive) | scalar
The output signal is the angle of the point-of-view selector, or POV Hat, in degrees from 0 to 360. If the selector is inactive, the signal is -1.
Joystick ID — The ID assigned to given joystick device
You can find the properties of the joystick that is connected to the system in the Game Controllers section of the system Control Panel.
Adjust I/O ports according to joystick capabilities — Dynamically adjust ports to correspond to joystick capabilities
on (default) |
If you enable this parameter, the Simulink 3D Animation software dynamically adjusts the ports to correspond to the capabilities of the connected joystick each time that you open the model. If the connected device does not have force-feedback capability, selecting this check box causes the removal of the force-feedback input from the block, even if you enable the Enable force-feedback input parameter.
The block ports do not have the full widths provided by the Windows® Game Controllers interface.
Enable force-feedback input — Support joysticks with force-feedback
on (default) |
If you select this check box, the Simulink 3D Animation software can support force-feedback joystick, steering wheel, and haptic (one that enables tactile feedback) devices.
Output Ports — Enable output ports for joystick commands
off (default) |
When the Adjust I/O ports according to joystick capabilities parameter is enabled, the output ports change to correspond to the actual capabilities of the connected joystick. On Windows platforms, the output ports have fixed maximum width provided by the system Game Controllers interface.