Receive net_ctrl packet from FlightGear
The Receive net_ctrl Packet from FlightGear block receives a network control and environment data packet, net_ctrl, from the simulation of a Simulink® model in the FlightGear simulator, or from a FlightGear session. This data packet is compatible with a particular version of FlightGear flight simulator. All the signals supported by the FlightGear net_ctrl data packet are supported by this block. The signals are arranged into multiple groups. Any group can be turned on or off. Zeros are inserted for packet values that are part of inactive signal groups.
In Rapid Accelerator mode, if you run a model that contains this block , the block produces zeroes (0s). It does not produce deployable code. In Accelerator mode, the block works as expected.
For details on signals and signal groups, see Inputs and Outputs.
To determine the source IP address, you can use one of several techniques, such as:
Use 127.0.0.1 for the local computer (localhost).
Ping another computer from a Windows® cmd.exe (or Linux® shell) prompt:
C:\> ping andyspc Pinging andyspc [22.214.171.124] with 32 bytes of data: Reply from 126.96.36.199: bytes=32 time=30ms TTL=253 Reply from 188.8.131.52: bytes=32 time=20ms TTL=253 Reply from 184.108.40.206: bytes=32 time=20ms TTL=253 Reply from 220.127.116.11: bytes=32 time=20ms TTL=253 Ping statistics for 18.104.22.168: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 20ms, Maximum = 30ms, Average = 22ms
On a Windows machine, type ipconfig and use the returned IP address:
H:\>ipconfig Windows IP Configuration Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : IP Address. . . . . . . . . . . . : 192.168.42.178 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.42.254
Select your FlightGear software version: v0.9.3, v0.9.8/0.9.8a, v0.9.9, v0.9.10, v1.0, v1.9.1, v2.0, v2.4, v2.6, v2.8, v2.10, v2.12, v3.0.
Note: If you are using a FlightGear version older than 2.0, 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.
Enter a valid IP address as a dot-decimal string. This IP address must be the address of the PC from which FlightGear is run.
For example, 10.10.10.3. You can also use a MATLAB expression that returns a valid IP address as a string. If FlightGear is run on the local PC, leave the default value of 127.0.0.1 (localhost).
UDP port that the block accepts data from. The sender sends data to the port specified in this parameter. This value must match the Origin port parameter of the Generate Run Script block. It must be a unique port number that no other application on the PC uses. The site, http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers, lists commonly known UDP port numbers. To identify UDP port numbers already in use on your PC, type:
netstat -a -p UDP
Specify the sample time (-1 for inherited).
|First||Platform||Type||Contains the controls information from FlightGear in uint8 format.|
|Windows and Linux|
744-by-1 vector (for FlightGear v3.0, v2.12, v2.10, v2.8, v2.6, v2.4, v2.0, v1.9, v1.0, v0.9.10)
536-by-1 vector (for FlightGear v0.9.9)
392-by-1 vector (for FlightGear v0.9.8)
424-by-1 vector (for FlightGear v0.9.3)
744-by-1 vector (for FlightGear v2.6*, v2.8*, v2.10*, v2.12*, v3.0*)
732-by-1 vector (for FlightGear v2.0, v2.4, v1.9, v1.0, v0.9.10)
524-by-1 vector (for FlightGear v0.9.9)
504-by-1 vector (for FlightGear v0.9.8)
400-by-1 vector (for FlightGear v0.9.3)
* On a Macintosh system with FlightGear 2.6, 2.8, 2.10, 2.12, and 3.0 you might see unexpected results (for example, very large or very small data values). For more information, see Macintosh Platform and FlightGear Version 2.6 or Later.