Receiving force and moment from external app and Sending update of aircraft rotation and position to external app #1313
-
Is it possible for jsbsim to communicate with external app via network like UDP or other protocol? It still a concept, but i want to create system where the physics come from let says SIMULINK and it can update the aerodynamic coefficients or forces and moments to jsbsim unreal and jsbsim will send back the position and rotation to the SIMULINK. Is it possible? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
@nmfarras what do you mean by "the physics" comes from an external app? Probably, at the generic time |
Beta Was this translation helpful? Give feedback.
-
Hmm, what are you really wanting/needing JSBSim to do? Reading between the lines I'm guessing you really just want to use it to generate outside visuals in conjunction with Unreal? If you just want outside visuals from Simulink are you aware of the Simulink FlightGear component? In which you perform all the 'physics' including calculating the accelerations, then integrating to get velocities and then integrating again to get pose (position and attitude) in Simulink and then the pose state on each time step is sent to FlightGear which acts purely as an image generator to generate the scene given the aircraft's pose. Do you have a particular need or preference for Unreal as opposed to FlightGear? |
Beta Was this translation helpful? Give feedback.
-
@nmfarras mentioned:
But yes, trying to split the state calculations and updates between Simulink and JSBSim is going to be tricky. My question, regarding a customer/client bringing a Simulink model that they want to fly in your engineering simulator is whether the ground interactions that you need to handle are simply with runways or do you really also need to model interactions between the aircraft and 3D structures like buildings etc.? I'm sort of assuming that often the Simulink model that a client brings may already have a ground interaction component in terms of modelling gear forces etc. and quite possibly a much more detailed and accurate gear contact model than the one provided by JSBSim. In which case wouldn't it make more sense to leave everything in Simulink in this case, and simply make sure that the DEM you use in your Unreal based simulation visuals matches the DEM, or supply your DEM to the Simulink model? In which, in this case your simulator would simply be providing the visuals, just like the examples you shared of Chris Lum using FlightGear and X-Plane as purely image generators. |
Beta Was this translation helpful? Give feedback.
-
I agree.
The “difficult" thing that JSBSim does well is finding the forces and moments from a given state (position, velocity, control position, altitude etc.). It then is able to account for these forces and moment, and keep track of all the reference frames etc. Just integrating those forces and moments, once you have appropriate forces, to update the state is fairly easy. It’s also something that Simulink can do well also.
So, it’s really not clear what you want JSBSim to do and what you want Simulink to do for your project. If you want both to calculate forces and both to integrate those forces into a new state, you will have to “trust” one as the correct state for your simulation. Then you can use that to drive graphics (with Flightgear, or Unreal, or whatever else you want)
Adam
|
Beta Was this translation helpful? Give feedback.
Yes, I was going to suggest doing it the way you've shown it.
I've done something similar in the past. In my case I didn't want to calculate the moment or force externally, rather I wanted to be able to modify the stability coefficient from an external program while JSBSim was running. So I made all the coefficients properties.