Integrate JSBSim to AirSim #496
Replies: 6 comments 17 replies
-
Here are a couple of property references to get you started for your first question. Note that internally JSBSim doesn't use SI units. jsbsim/src/models/FGPropagate.cpp Lines 822 to 832 in 08d2f85 jsbsim/src/models/FGPropagate.cpp Lines 873 to 875 in 08d2f85 jsbsim/src/models/FGAccelerations.cpp Lines 348 to 354 in 08d2f85 |
Beta Was this translation helpful? Give feedback.
-
Yep that was just to get you started and point you to the relevant files as opposed to being a comprehensive list. There are a number of position options with different frames of reference, e.g. ECEF, ECI etc. In terms of collisions that's potentially going to be tricky. JSBSim has the concept of contact points which can be defined in the aircraft model, e.g. the nose, wing tips, tail etc. which are used for collision detection typically with a ground plane. It also includes details for the landing gear with spring coefficients etc. to model collisions/landing between the gear and the ground. Now it sounds like you want to use Unreal to perform collision detection and then take some data from it's collision calculations to reset the kinematic states in JSBSim? |
Beta Was this translation helpful? Give feedback.
-
@jonyMarino are you planning on implementing all the necessary calculations of the gear forces, reactions etc. as opposed to providing a ground callback to JSBSim for JSBSim to do that?
If you do want to go down that route then take a look at the following discussion. |
Beta Was this translation helpful? Give feedback.
-
@jonyMarino thinking about this a bit more what are the main reasons for using Unreal to perform the collision detection and the extra complication of trying to then integrate that with JSBSim? As opposed to letting JSBSim perform the collision detection, handle the physics of the collision etc. simply by providing a ground callback to JSBSim? Otherwise it sounds like a lot of extra work. You would need to grab the Some examples of the jsbsim/aircraft/c172p/c172p.xml Lines 122 to 136 in 08d2f85 jsbsim/aircraft/c172p/c172p.xml Lines 176 to 187 in 08d2f85 I've used the ground callback mechanism in the past with a simulator I built that integrates Prepar3d and JSBSim, i.e. passing the terrain data that I retrieve from Prepar3d for each simulation time-step to JSBSim. For example for someone like @AOS55 who is wanting to use the combination of AirSim and JSBSim for reinforcement learning with computer vision processing the AirSim scenery and a control loop to then land the aircraft I'm guessing he'd want JSBSim's ground contact processing of the landing gear etc. in order to work out whether the ML agent successfully landed the aircraft or not. |
Beta Was this translation helpful? Give feedback.
-
@jonyMarino You could also try to integrate directly into jsbsim bridge: https://github.com/Auterion/px4-jsbsim-bridge and add a interface for airlib (if this helps) |
Beta Was this translation helpful? Give feedback.
-
@Jaeyoung-Lim Then we should do something more like that bridge. Thank you for all the info. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I am trying to integrate JSBSim as a C ++ library into AirSim as a proof of concept.
We have managed to run a JSBSim model inside AirSim. Now we have the following questions to continue:
First: For the dynamics of the collisions and the sensors, we have to obtain all the kinematics states from jsbsim (position (NED), orientation (Quaternion), linear and angular velocity, and linear and angular acceleration) in the SI system. By what JSBSim properties are they obtained?
Second: Collisions are calculated within AirSim, so we must set the calculated kinematics states in the running jsbsim model after a collision. How can we do that?
@seanmcleod
Beta Was this translation helpful? Give feedback.
All reactions