Integration with Iron Bird #393
Replies: 5 comments 2 replies
-
Thanks for using JSBSim for your master thesis 👍
Here Port is the TCP/UDP port number and can be any number that complies with the OSes of the 2 computers that will communicate (see https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers for example of valid port numbers). |
Beta Was this translation helpful? Give feedback.
-
Out of interest, does your Iron Bird rig consist of hardware from some specific aircraft, or are they just some generic actuators? |
Beta Was this translation helpful? Give feedback.
-
@sthelia thanks for background info, always useful and interesting to know how JSBSim is being used. |
Beta Was this translation helpful? Give feedback.
-
Is there any information about how the data is being sent over socket via TCP or UDP? My current workaround just to see what is going on with Matlab is to create a TCP server, then start the JSBSim running. Matlab then looks at BytesAvailable and reads that. The data is received as unicode and I can then translate that to a string. This is however not real time, I can read around 2 seconds worth of data here. I'm trying to make sense of what a package, byte, datagram etc is and how JSBSim handles this? I also just read this on Wikipedia, which might make me want to do UDP instead since the real time compatibility is going to be important.
|
Beta Was this translation helpful? Give feedback.
-
The most accurate and up to date information is the source code 😉 There is a JSBSim Reference Manual although it hasn't been updated in a long time, but the section on socket output is still pretty accurate. http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf First thing to be aware of is that there are two different socket output options that you can specify. <output type="SOCKET"..... >
<output type="FLIGHTGEAR"..... > The main difference between the two is that the Depending on the tools/programming language you're using to receive the network packets reading the plain text packets may be easier than processing a binary structure. You mentioned running netcat successfully earlier right, so that shows you exactly the plain text data being sent via the <output name="localhost" type="SOCKET" port="1138" rate="1">
<property>velocities/vc-kts</property>
<property>position/h-agl-ft</property>
</output> You can see that data looks very similar (excluding the nc.exe -l -p 1138
<LABELS> ,Time,vc-kts,h-agl-ft
0, 285.0745, 30000
0.99996, 283.9128, 29993.57
1.99992, 283.0492, 29974.78
2.99988, 282.5345, 29941.87 So in general you would need to split the incoming data based on a newline, then split it based on commas and then you would have the individual fields as plain text versions of the properties you selected to transmit. At this stage I wouldn't worry about the difference between TCP and UDP. You're going to be running this on a LAN right, it's not as if the one PC is going to be sitting somewhere on the internet with multiple routers between the PCs. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone!
I’m an aerospace student and have just started my master thesis work. The project is to try to integrate JSBSim with an Iron Bird for testing control surface actuators.
I’m currently in the start up phase, getting to know the program and the rig I’ll be working on, so I’m sure questions will arise as time goes on. Happy to get input of what would be interesting to include in the project or things to consider before getting started!
My current idea is that I want to continuously pass some properties, say dynamic pressure and requested elevator deflection, to the rig. Later I would also like to integrate the actual deflection as an input to JSBSim. The rig is controlled through Simulink (and speedgoat). I’ve seen that JSBSim is capable of both input and output of different types.
I’m not familiar with using telnet, but would that be a good option to looking into if JSBSim and Simulink ran on different computers? Would there be a difference if they’re running on separate computers and connected by cable?
Say that I would like to run a simple example, for example the simple ball example. If I want to run it in realtime, I add the
--realtime
when running the program. If I would like to see the altitude updated at 10Hz, I'm thinking I would do something similar to:What does the name
localhost
signify in this case? How do I determine which port number to use? Can I see the output in another terminal if I access the port withtelnet localhost port
or something similar? I'm on Mac.Thanks in advance and have a great weekend!
Beta Was this translation helpful? Give feedback.
All reactions