Unpack net_ctrl Packet from FlightGear
Unpack net_ctrl
variable packet received from
FlightGear
Libraries:
Aerospace Blockset /
Animation /
Flight Simulator Interfaces
Description
The Unpack net_ctrl Packet from FlightGear block unpacks
net_ctrl
variable packets received from FlightGear via the
Receive net_ctrl Packet from FlightGear block, and makes them
available for the Simulink® environment.
The Aerospace Blockset™ product supports FlightGear versions starting from v2.6. If you are using a FlightGear version older than 2.6, the model displays a notification from the Simulink Upgrade Advisor. Consider using the Upgrade Advisor to upgrade your FlightGear version. For more information, see Supported FlightGear Versions.
Examples
HL-20 Project with Optional FlightGear Interface
Model NASA HL-20 lifting body and controller modeled in Simulink and Aerospace Blockset, using FlightGear for visualization.
Ports
Input
net_ctrl — FlightGear packet to be unpacked
array
FlightGear packet to be unpacked, specified as an array.
Data Types: uint8
Output
wind_speed_kt — Wind speed
scalar
Wind speed, specified as a scalar, in knots.
Dependencies
To enable this port, select the Show environment outputs check box.
Data Types: double
wind_dir_deg — Wind direction
scalar
Wind direction, specified as a scalar, in deg.
Dependencies
To enable this port, select the Show environment outputs check box.
Data Types: double
turbulence_norm — Turbulence norm
scalar
Turbulence norm, specified as a scalar.
Dependencies
To enable this port, select the Show environment outputs check box.
Data Types: double
temp_c — Ambient temperature
scalar
Ambient temperature, specified as a scalar, in deg C.
Dependencies
To enable this port, select the Show environment outputs check box.
Data Types: double
press_inhg — Ambient pressure
scalar
Ambient pressure, specified as a scalar, in inHg.
Dependencies
To enable this port, select the Show environment outputs check box.
Data Types: double
hground — Ground elevation
scalar
Ground elevation, specified as a scalar, in m.
Dependencies
To enable this port, select the Show environment outputs check box.
Data Types: double
magvar — Local magnetic variation
scalar
Local magnetic variation, specified as a scalar.
Dependencies
To enable this port, select the Show environment outputs check box.
Data Types: double
icing — Icing status
scalar
Icing status, specified as a scalar, in deg.
Dependencies
To enable this port, select the Show environment outputs check box.
Data Types: uint32
aileron — Normalized aileron position
1
| scalar
Normalized aileron position [-1,1], specified as a scalar.
Dependencies
To enable this port, select the Show control surface position outputs check box.
Data Types: double
elevator — Normalized elevator position
1
| scalar
Normalized elevator position [-1,1], specified as a scalar.
Dependencies
To enable this port, select the Show control surface position outputs check box.
Data Types: double
rudder — Normalized rudder position
1
| scalar
Normalized rudder position [-1,1], specified as a scalar.
Dependencies
To enable this port, select the Show control surface position outputs check box.
Data Types: double
aileron_trim — Normalized aileron trim position
scalar
Normalized aileron trim position [-1,1], specified as a scalar.
Dependencies
To enable this port, select the Show control surface position outputs check box.
Data Types: double
elevator_trim — Normalized elevator trim position
1
| scalar
Normalized elevator trim position [-1,1], specified as a scalar.
Dependencies
To enable this port, select the Show control surface position outputs check box.
Data Types: double
rudder_trim — Normalized rudder trim position
1
| scalar
Normalized rudder trim position [-1,1], specified as a scalar.
Dependencies
To enable this port, select the Show control surface position outputs check box.
Data Types: double
flaps — Normalized flaps position
1
| scalar
Normalized flaps position [-0,1], specified as a scalar.
Dependencies
To enable this port, select the Show control surface position outputs check box.
Data Types: double
spoilers — Normalized spoilers position
1
| scalar
Normalized spoilers position [0,1], specified as a scalar.
Dependencies
To enable this port, select the Show control surface position outputs check box.
Data Types: single
speedbrake — Normalized speedbrake position
1
| scalar
Normalized speedbrake position [0,1], specified as a scalar.
Dependencies
To enable this port, select the Show control surface position outputs check box.
Data Types: single
flaps_power — Power for flaps
1
| scalar
Power for flaps, specified as a scalar. A value of
1
indicates that power is available.
Dependencies
To enable this port, select the Show control surface position outputs check box.
Data Types: uint32
flap_motor_ok — Flap motor powered
scalar
Flap motor powered, specified as a scalar.
Dependencies
To enable this port, select the Show control surface position outputs check box.
Data Types: uint32
num_engines — Number of valid engines
scalar
Number of valid engines, specified as a scalar.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
master_bat — Master battery switch
vector
Master battery switch, specified as a vector.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
master_alt — Master alternator switch
vector
Master alternator switch, specified as a vector.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
magnetos — Magnetos switch
scalar
Magnetos switch, specified as a scalar.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
starter_power — Power to start motor
1
| vector
Power to starter motor, specified as a vector. A value of
1
indicates that power is available.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
throttle — Normalized throttle position
1
| vector
Normalized throttle position [0,1], specified as a vector.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: double
mixture — Normalized mixture lever position
1
| vector
Normalized mixture lever position [0,1], specified as a vector.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: double
condition — Normalized condition
1
| vector
Normalized condition [0,1], specified as a vector.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
fuel_pump_power — Normalized speedbrake position
1
| scalar
Power to fuel pump, specified as a vector. A value of
1
indicates that pump is on.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
prop_advance — Propeller advance
1
| vector
Propeller advance [0,1], specified as a vector.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: double
feed_tank_to — Feed tank to switch
vector
Feed tank to switch, specified as a vector.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
reverse — Reverse switch
vector
Reverse switch, specified as a vector.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
engine_ok — Engine status indicator
vector
Engine status indicator, specified as a vector.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
mag_left_ok — Left magneto status indicator
vector
Left magneto status indicator, specified as a vector.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
mag_right_ok — Right magneto status indicator
vector
Right magneto status indicator, specified as a vector.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
spark_plugs_ok — Normalized speedbrake position
vector
Spark plugs status indicator, specified as a vector. A value of
0
indicates that the plugs have failed.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
oil_press_status — Oil pressure status indicator
0
| 1
| 2
| scalar
Oil pressure status indicator, specified as a vector.
0
— Normal oil pressure1
— Low oil pressure2
— Failed oil pressure
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
fuel_pump_ok — Fuel management status indicator
vector
Fuel management status indicator, specified as a vector.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
num_tanks — Number of valid tanks
scalar
Number of valid tanks, specified as a scalar.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
fuel_selector — Fuel selector
scalar
Fuel selector, specified as a vector.
0
— Off1
— On
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: single
xfer_pump — Specify transfer
vector
Specifies transfer from array value to tank, specified by value as a vector.
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: uint32
cross_feed — Cross feed valve
scalar
Cross feed valve, specified as a scalar.
0
— False1
— On
Dependencies
To enable this port, select the Show engine/fuel outputs check box.
Data Types: single
brake_left — Left brake pedal position pilot
scalar
Left brake pedal position pilot, specified as a scalar.
Dependencies
To enable this port, select the Show landing gear outputs check box.
Data Types: double
brake_right — Right brake pedal position pilot
scalar
Right brake pedal position pilot, specified as a scalar.
Dependencies
To enable this port, select the Show landing gear outputs check box.
Data Types: double
copilot_brake_left — Left brake pedal position pilot
scalar
Left brake pedal position pilot, specified as a scalar.
Dependencies
To enable this port, select the Show landing gear outputs check box.
Data Types: double
copilot_brake_right — Right brake pedal position pilot
scalar
Right brake pedal position pilot, specified as a scalar.
Dependencies
To enable this port, select the Show landing gear outputs check box.
Data Types: double
brake_parking — Brake parking position
scalar
Brake parking position, specified as a scalar.
Dependencies
To enable this port, select the Show landing gear outputs check box.
Data Types: double
gear_handle — Gear handle position
scalar
Gear handle position, specified as a scalar.
0
— Gear handle up1
— Gear handle down
Dependencies
To enable this port, select the Show landing gear outputs check box.
Data Types: uint32
master_avionics — Master avionics switch
scalar
Master avionics switch, specified as a scalar.
Dependencies
To enable this port, select the Show avionic outputs check box.
Data Types: uint32
comm_1 — Comm 1 frequency
scalar
Comm 1 frequency, specified as a scalar, in Hz.
Dependencies
To enable this port, select the Show avionic outputs check box.
Data Types: double
comm_2 — Comm 2 frequency
scalar
Comm 2 frequency, specified as a scalar, in Hz.
Dependencies
To enable this port, select the Show avionic outputs check box.
Data Types: double
nav_1 — Nav 1 frequency
scalar
Nav 1 frequency, specified as a scalar, in Hz.
Dependencies
To enable this port, select the Show avionic outputs check box.
Data Types: double
nav_2 — Nav 2 frequency
scalar
Nav 2 frequency, specified as a scalar, in Hz.
Dependencies
To enable this port, select the Show avionic outputs check box.
Data Types: double
Parameters
Show control surface position outputs — Control surface position outputs
off
(default) | on
Select this check box to include the control surface position outputs from
the FlightGear net_ctrl
data packet.
Dependencies
Select this check box to enable these input ports.
Signal Group 1: Control surface position outputs
Name | Units | Type | Width | Description |
---|---|---|---|---|
| 1 (dimensionless) | double | 1 | Normalized aileron position [-1,1] |
| 1 (dimensionless) | double | 1 | Normalized elevator position [-1,1] |
| 1 (dimensionless) | double | 1 | Normalized rudder position [-1,1] |
| 1 (dimensionless) | double | 1 | Normalized aileron trim position [-1,1] |
| 1 (dimensionless) | double | 1 | Normalized elevator trim position [-1,1] |
| 1 (dimensionless) | double | 1 | Normalized rudder trim position [-1,1] |
| 1 (dimensionless) | double | 1 | Normalized flaps position [-0,1] |
| 1 (dimensionless) | double | 1 | Normalized spoilers position [0,1] |
| 1 (dimensionless) | double | 1 | Normalized speedbrake position [0,1] |
| 1 (dimensionless) | uint32 | 1 | Power for flaps ( |
| — | uint32 | 1 | Flap motor powered |
Programmatic Use
Block Parameter:
ShowControlSurfacePositionOutputs |
Type: character vector |
Values:
'off' | 'on' |
Default:
'off' |
Show engine/fuel outputs — Engine/fuel outputs
off
(default) | on
Select this check box to include the engine and fuel outputs from the
FlightGear net_ctrl
data packet.
Dependencies
Select this check box to enable these input ports.
Signal Group 2: Engine/fuel outputs
Name | Units | Type | Width | Description |
---|---|---|---|---|
| — | uint32 | 1 | Number of valid engines |
| — | uint32 | 4 | Master battery switch |
| — | uint32 | 4 | Master alternator switch |
| — | uint32 | 4 | Magnetos switch |
| — | uint32 | 4 | Power to starter motor ( |
| 1 (dimensionless) | double | 4 | Normalized throttle position [0,1] |
| 1 (dimensionless) | double | 4 | Normalized mixture lever position [0,1] |
| 1 (dimensionless) | double | 4 | Normalized condition [0,1] |
| — | uint32 | 4 | Power to fuel pump |
| 1 (dimensionless) | double | 4 | Propeller advance [0,1] |
| — | uint32 | 4 | Feed tank to switch |
| — | uint32 | 4 | Reverse switch |
| — | uint32 | 4 | Engine status indicator |
| — | uint32 | 4 | Left magneto status indicator |
| — | uint32 | 4 | Right magneto status indicator |
| — | uint32 | 4 | Spark plugs status indicator ( |
| — | uint32 | 4 | Oil pressure status indicator (0 = normal, 1 = low, 2 = full failure) |
| — | uint32 | 4 | Fuel management status indicator |
| — | uint32 | 1 | Number of valid tanks |
| — | uint32 | 8 | Fuel selector. ( |
| — | uint32 | 5 | Specifies transfer from array value to tank specified by value |
| — | uint32 | 1 | Cross feed valve ( |
Programmatic Use
Block Parameter:
ShowEngineFuelOutputs |
Type: character vector |
Values:
'off' | 'on' |
Default:
'off' |
Show landing gear outputs — Landing gear outputs
off
(default) | on
Select this check box to include the landing gear outputs from the
FlightGear net_ctrl
data packet.
Dependencies
Select this check box to enable these input ports.
Signal Group 3: Landing gear outputs
Name | Units | Type | Width | Description |
---|---|---|---|---|
| — | double | 1 | Left brake pedal position pilot |
| — | double | 1 | Right brake pedal position pilot |
| — | double | 1 | Left brake pedal position copilot |
| — | double | 1 | Right brake pedal position copilot |
| — | double | 1 | Brake parking position |
| — | uint32 | 1 | Gear handle position ( |
Programmatic Use
Block Parameter:
ShowLandingGearOutputs |
Type: character vector |
Values:
'off' | 'on' |
Default:
'off' |
Show avionic outputs — Avionic outputs
off
(default) | on
Select this check box to include the avionic outputs from the FlightGear
net_ctrl
data packet.
Dependencies
Select this check box to enable these input ports.
Signal Group 4: Avionics outputs
Name | Units | Type | Width | Description |
---|---|---|---|---|
| — | uint32 | 1 | Master avionics switch |
| Hz | double | 1 | Comm 1 frequency |
| Hz | double | 1 | Comm 2 frequency |
| Hz | double | 1 | Nav 1 frequency |
| Hz | double | 1 | Nav 2 frequency |
Programmatic Use
Block Parameter:
ShowAvionicOutputs |
Type: character vector |
Values:
'off' | 'on' |
Default:
'off' |
Show environment outputs — Environment outputs
on
(default) | off
Select this check box to include the environment outputs from the
FlightGear net_ctrl
data packet.
Dependencies
Select this check box to enable these input ports.
Signal Group 5: Environment outputs
Name | Units | Type | Width | Description |
---|---|---|---|---|
| knot | double | 1 | Wind speed |
| deg | double | 1 | Wind direction |
| — | double | 1 | Turbulence norm |
| deg C | double | 1 | Ambient temperature |
| inHg | double | 1 | Ambient pressure |
| m | double | 1 | Ground elevation |
| deg | double | 1 | Local magnetic variation |
| – | uint32 | 1 | Icing status |
Programmatic Use
Block Parameter:
ShowEnvironmentOutputs |
Type: character vector |
Values:
'off' | 'on' |
Default:
'on' |
Sample time — Sample time
1/30 (default) | scalar
Specify the sample time (-1 for inherited), as a scalar.
Programmatic Use
Block Parameter:
SampleTime |
Type: character vector |
Values: scalar |
Default:
'1/30' |
Version History
Introduced in R2012a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)