Main Content

Pilot Joystick

Provide joystick interface on Windows platform

  • Pilot Joystick block

Libraries:
Aerospace Blockset / Animation / Animation Support Utilities

Alternative Configurations of Pilot Joystick Block:
Pilot Joystick All

Description

The Pilot Joystick block provides a pilot joystick interface for a Windows® platform. Roll, pitch, yaw, and throttle are mapped to the joystick X, Y, R, and Z channels respectively.

The Pilot Joystick and Pilot Joystick All blocks are alternative configurations of the same block.

  • Pilot Joystick — Outputs four axes.

  • Pilot Joystick All — Outputs all channels.

To generate deployable code, select one of the configuration parameter Microsoft® Visual Studio® C++ nmake toolchains from Code Generation > Toolchain.

Examples

Limitations

  • The Pilot Joystick block is not supported in Simulink Online.

  • If the joystick does not support an R (rudder or twist) channel, yaw output is set to zero. Outputs are of type double, except when Joystick ID is set to AllOutputs mode, which is a uint32 flagword of bits. On non Microsoft platforms, this block outputs zeros.

  • Pitch value has the opposite sense as that delivered by the FlightGear joystick interface.

Ports

Output

expand all

Roll command, specified in the range [-1, 1], that corresponds to the joystick left and right directions.

Dependencies

To enable this port, set Output configuration to FourAxis.

Data Types: double

Pitch command, specified in the range [-1, 1], that corresponds to the joystick forward or down and back and up directions.

Dependencies

This output port is enabled when the Output configuration parameter is set to FourAxis.

Data Types: double

Yaw command, specified in the range [-1, 1], that corresponds to the joystick twist left and twist right directions.

Dependencies

To enable this port, set Output configuration to FourAxis.

Data Types: double

Throttle command, specified in the range [0, 1], that corresponds to the joystick min and max position.

Dependencies

To enable this port, set Output configuration to FourAxis.

Data Types: double

Parameters

expand all

Specify the joystick ID as

  • Joystick1

  • Joystick2

  • Joystick3

  • Joystick4

  • Joystick5

  • Joystick6

  • Joystick7

  • Joystick8

  • Joystick9

  • Joystick10

  • Joystick11

  • Joystick12

  • Joystick13

  • Joystick14

  • Joystick15

  • Joystick16

  • None

Programmatic Use

Block Parameter: JoystickID
Type: character vector
Values: Joystick1 | Joystick2 | Joystick3 | Joystick4 | Joystick5 | Joystick6 | Joystick7 | Joystick8 | Joystick9 | Joystick10 | Joystick11 | Joystick12 | Joystick13 | Joystick14 | Joystick15 | Joystick16 | None
Default: 'Joystick1'

Joystick output configuration, specified as FourAxis or AllOutputs. For more information on the AllOutputs configuration, see Pilot Joystick All.

Programmatic Use

Block Parameter: OutputConfiguration
Type: character vector
Values: FourAxis | AllOutputs
Default: 'FourAxis'

Specify the sample time (-1 for inherited), specified as a scalar.

Programmatic Use

Block Parameter: SampleTime
Type: character vector
Values: scalar
Default: '1/30'

Alternative Configurations

expand all

The Pilot Joystick All block outputs all channels.

Libraries:
Aerospace Blockset / Animation / Animation Support Utilities

Version History

Introduced before R2006a

expand all