Main Content

Pilot Joystick All

Provide joystick interface in All Outputs configuration on Windows platform

  • Library:
  • Aerospace Blockset / Animation / Animation Support Utilities

  • Pilot Joystick All block

Description

The Pilot Joystick All block provides a pilot joystick interface for a Windows® platform. Analog is mapped to the joystick X, Y, Z, R, U, and V channels. Buttons and POV are mapped to up to 32 joystick button states and the joystick point-of-view hat.

You can also configure the block to output four axes by setting the Output configuration parameter to FourAxis.

This block does not produce deployable code.

Limitations

  • 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

Analog output, returned according to:

Array Number

Channel

Output Range

Joystick

Description

1

X

[-1, 1]

[left, right]

Roll command

2

Y

[-1, 1]

[forward/down, back/up]

Pitch command

3

Z

[ 0, 1]

[min, max]

Throttle command

4

R

[-1, 1]

[left, right]

Yaw command

5

U

[ 0, 1]

[min, max]

U channel value

6

V

[ 0, 1]

[min, max]

V channel value

Data Types: double

Button output, returned as a flagword containing up to 32 button states on the buttons channel. Bit 0 is button 1, Bit 1 is button 2, and so forth.

Data Types: uint32

Point-of-view, returned as a hat value in degrees on the POV channel. Zero degrees is straight ahead, 90 degrees is to the left, and so forth.

Data Types: double

Parameters

expand all

Specify the joystick ID as Joystick1, Joystick2, or None.

Programmatic Use

Block Parameter: JoystickID
Type: character vector
Values: Joystick1 | Joystick2 | 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'
Introduced in R2007a