How To Connect MATLAB and Simulink to FlightGear - Full Tutorial for Beginners

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • #FlightGearSimulations #MathWorks #Simulink
    Dear Engineers,
    In this video, I go over thoroughly, the process to install FlightGear and to connect MATLAB to it. FlightGear is an open source flight simulator which is used for the simulation of aircraft dynamics. It is a very powerful tool used in the aerospace industry worldwide.
    In this tutorial, I cover:
    1) Setting up FlightGear
    2) Installing new aircraft
    3) Connecting MATLAB to FlightGear (in full step by step detail)
    I would sincerely like to thank a PhD graduate from Georgia Institute of Technology, in helping me extensively with this process: His contact information is:
    Imon Chakraborty, Ph.D.,
    Professor, Auburn Univeristy, AL
    LINKS USED IN THE VIDEO:
    FlightGear: www.flightgear....
    MATLAB Compatibility: www.mathworks....
    New Aircraft: mirrors.ibiblio...
    Code Tutorial: www-mdp.eng.cam...
    MY CODE:
    ________________________________________________________________
    SET FG_ROOT=C:\Program Files\FlightGear\data
    SET FG_SCENERY=C:\Program Files\FlightGear\data\Scenery;C:\Program Files\FlightGear\scenery;C:\Program Files\FlightGear\terrasync
    .\\bin\win64\fgfs --aircraft=HL21 --fdm=null --enable-auto-coordination --native-fdm=socket,in,30,localhost,5502,udp --fog-disable --enable-clouds3d --start-date-lat=2004:06:01:09:00:00 --enable-sound --visibility=15000 --in-air --prop:/engines/engine0/running=true --disable-freeze --airport=KMIA --runway=06 --altitude=8000 --heading=0 --offset-distance=0 --offset-azimuth=0 --enable-rembrandt
    __________________________________________________________
    ~~My Udemy Courses on Motion Planning / Navigation / Trajectory Planning:
    www.udemy.com/...
    My Instagram: / vinayak_desh
    My Website: www.vinayakd.com/

Комментарии • 83

  • @VDEngineering
    @VDEngineering  5 лет назад +6

    Here is Part 2!, It answers all your FAQ :)
    ruclips.net/video/b-hK5-4D5Rc/видео.html
    Part 3 covers way more cool stuff!
    ruclips.net/video/kFklbdU9eSQ/видео.html&

    • @hamasahmad8444
      @hamasahmad8444 10 месяцев назад

      You have used a joystick in this video

  • @richardjonesiii2856
    @richardjonesiii2856 3 года назад +8

    You are the reason I'm not just completing my bachelor's, but earning it.

  • @bundeligeetsanrakshan3246
    @bundeligeetsanrakshan3246 Год назад +1

    Your videos are nice and best for beginner to intermediate learners. #Thanks for the upload.

  • @naut_nigel
    @naut_nigel 5 лет назад +1

    Thank you for sharing, Vin! I'm a new engineer and this video will help me do my job!

  • @gopalmeharwade3816
    @gopalmeharwade3816 5 лет назад +1

    Very Nice Information! I was looking for these kind of stuff especially interface of MATLAB with FlightGear!

  • @adityarajiv6346
    @adityarajiv6346 3 года назад

    Nice video!.
    I wanted to know how does flight gear read data when user wants to send to it using generic protocol and UDP sockets

  • @andrewnone5389
    @andrewnone5389 2 месяца назад

    Can you help me? I cannot find aircraft model HL21 for FlightGear simulation. Where can I download it? Or can you share it with me?

  • @SiemensSxg75Patch
    @SiemensSxg75Patch 6 лет назад +3

    When I run the bat-file it starts FG, but the window of work with the simulink model becomes unavailable, I can not start the simulation. What could it be? I'm using Matlab 2017b and FG 3.4.0. Thank you!

    • @mehmetcansen8381
      @mehmetcansen8381 6 лет назад

      same problem, could you find any solution?

    • @paulhoffman9926
      @paulhoffman9926 5 лет назад

      I had to close out of matlab, then run the batch file, then restart matlab and open Simulink. Then it allowed me to run the Simulink.

    • @kumudraaung5821
      @kumudraaung5821 5 лет назад

      Hi all, I'm having trouble trying to get FlightGear to use the simulated data I generated in Matlab. My sh file runs, but FlightGear says "simulation paused". Any advice?

    • @divijsharma0102
      @divijsharma0102 4 года назад +1

      @VDEngineering Many people are getting this problem. Please give a solution.

  • @alimigtwenyone5337
    @alimigtwenyone5337 2 года назад

    Tanks of information you have shared 🙏😊🌹

  • @amitmalse9960
    @amitmalse9960 3 года назад

    Hi, this is a very informative video, thank you for sharing the link to the second part too. I am a student and I don't have the Simulink license so I wanted to know if I can directly use the FlightGear simulator only with MATLAB. My other query is, I want to simulate rocket trajectory so I wanted to know to what altitude does the FlightGear supports the simulation?

  • @eskayforlife6750
    @eskayforlife6750 2 года назад

    Thank you for the video

  • @datvuong7420
    @datvuong7420 3 года назад

    could we animate two moving objects in one animation?

  • @hritikpatil6035
    @hritikpatil6035 2 года назад

    Hi VD, I just want to know how did you create batch file and what was the code inside that batch file

  • @pavankumarkoratikere7045
    @pavankumarkoratikere7045 5 лет назад

    @VDEnginnering, how to add airports ? Whenever I download scenery, there is no airport folder in that.

  • @ucontrolchannel5967
    @ucontrolchannel5967 4 года назад

    very good job, thank you !!!!!

  • @Crusader_No_Regret
    @Crusader_No_Regret Год назад

    how to get a rocket model for flightgear? And in which folder should I put the file?

  • @thenguyenduc9426
    @thenguyenduc9426 5 лет назад +1

    wonderful

  • @tanguydetroz1668
    @tanguydetroz1668 4 года назад

    Hello, many thanks for this brilliant tutorial; is there any possibility to get the full detail of the diagram presented at 6'37 (either in slx file or by opening (in video) all elements?

  • @devinhunter8609
    @devinhunter8609 3 года назад

    Could you explain how you went about installing the HL-20 Model into FlightGear?

  • @abhijeetdhillon9591
    @abhijeetdhillon9591 4 года назад

    hey i really love your videos !!! i am trying to learn autopilot systems can you suggest any books which will help me?

  • @nmdg4685
    @nmdg4685 4 года назад

    Sir, I am using Matlab 2016b. HereI can not find the 'Function block parameters:h '. What should I do?

  • @user-bj5ru9pc2h
    @user-bj5ru9pc2h 5 лет назад +1

    Hello! I can't to build scheme. I don't understand, where to find blocks "x", "h", "pitch". Could you explain hpw to build scheme and which characteristic did you chose in blocks?

    • @mohammadraihanhafiz2074
      @mohammadraihanhafiz2074 4 года назад

      Hello, Have you found the solution?

    • @rashimaru1722
      @rashimaru1722 3 года назад

      hey! which blocks r used for x/pitch, that '0'/ '-30 and and 'in metres'? did you find the answer?

  • @leonhartdragomir8948
    @leonhartdragomir8948 7 лет назад +1

    Hi, regarding the .bat file code, what if I wish to keep the flight dynamics in flight gear? Do I simply remove '-fdm=null' or do I write something else instead? Similarly, if I wanted the aircraft to start on the ground, how do I change '--in-air'?

    • @VDEngineering
      @VDEngineering  7 лет назад

      Try to adjust altitude to make it start on the ground, or simply change it to -ground. Let me know what works, haven't tried this myself unfortunately.
      You remove fdm-null, worked for me
      Although if you are running Simulink I strongly encourage you to disable the fdm

  • @tieuhihan6308
    @tieuhihan6308 4 года назад

    hello! thank you for video! but i have a question! ^^ Can I simulate the helicopter in that household?

  • @utsavnangalia7580
    @utsavnangalia7580 6 лет назад

    Is there any way we can contact you personally?
    BTW, thanx for the videos, really helpful

  • @rashimaru1722
    @rashimaru1722 3 года назад

    hey! which blocks r used for x/pitch, that '0'/ '-30 and and 'in metres'?

  • @flame_must
    @flame_must 2 года назад

    Can I get the full simulink design of the current circuit from anywhere???
    Plzz someone tell about that..

  • @hamasahmad8444
    @hamasahmad8444 10 месяцев назад

    Bro can we use flight gear for a simulink aircraft model without a physical joystick? If yes can u plz guide me on that a bit Thanks

  • @ddw.3381
    @ddw.3381 6 лет назад +1

    Thanks,so great videos.But I want to ask you for help about the scenery in the FlightGear.The version I used :matlab2017b,FlightGear2017.1.When I set up my FlightGear with the airport KSFO,the interface of the Fligtgear is full of sea water and sky without terrain. But in the default condition at the ENBR airport ,it is normal and right. When I run the matlab and flightgear together,the plane can fly with the only terrain problem as I said.Do you know what is wrong with my flightgear?
    by the way ,the version 2017.3 flightgear is normal but matlab does not support.

    • @VDEngineering
      @VDEngineering  6 лет назад

      You haven't installed the scenery, it has to be downloaded and installed separately from another website.

    • @ddw.3381
      @ddw.3381 6 лет назад +1

      Thank you,I have solved my problem just as you said.I selected the automatic download scenery.

  • @learntounderstand6225
    @learntounderstand6225 4 года назад

    how can i do for Quadcopter? reply asap

  • @bishoymagdi5533
    @bishoymagdi5533 5 лет назад

    Iam making a simulation of NASA space shuttle using Matlab Simulink with Flightgear Simulator.
    Iam Using Matlab R2016b and Flightgear 2016.1.1 and the first time i simulate it i got undefined variable for pitch, DR but i know that first i must run the shuttle model m file then i have to run the run first m file this will make pitch, DR have values from the excel so i solved this problem but after that i have the problem in the fifth picture.
    Iam a chemical engineering student in a bachelor project so i dont know so much about simulink and aerodynamics.
    I want a quick reply to solve this error and thanks.
    my ERROR is:
    The 'Vector of input values' in block 'model/h' must be a real vector that contains at least two elements
    Component:Simulink | Category:Modelerror
    The 'Vector of input values' in block 'model/pitch' must be a real vector that contains at least two elements
    Component:Simulink | Category:Modelerror
    The 'Vector of input values' in block 'model/x' must be a real vector that contains at least two elements

  • @MrVicenteRJ
    @MrVicenteRJ 3 года назад

    Hello, i am trying to develop a rocket with a TVC control sistem for my final degree tessis and i am considering the "aerospace pack" with FlightGear simulation and the "siscape mechanics" pack, which also allow me to simulate. And I would like to ask if it is possible to upload my model to FlightGear as I can with simscape Mechanics. Thanks for all your videos, they sure help me a lot!

    • @MrVicenteRJ
      @MrVicenteRJ 2 года назад

      For anyone struggling, Christopher Lum has a more recent approach to linking Simulink and Flight Gear which is much easier and has actually worked for me. Leave the link here: ruclips.net/video/f8tdTiuj5lo/видео.html
      Don't mean to undermine this tutorial. VDEngineering is such a great and helpful channel, but this particular tutorial is much more up-to-date there.

  • @charanhm5357
    @charanhm5357 7 лет назад

    sir,
    we are facing problem in connecting the maatlab simulink with flight gear .if possible please suggest the correct combination of matlab version and flight gearversion

    • @VDEngineering
      @VDEngineering  7 лет назад

      Which version of MATLAB do you have? Please be specific, e.g. 2016a,2016b e
      1)As soon as you open MATLAB, it mentions the version on the top left corner of the flash screen
      2)Or, open MATLAB type in 'version'.
      Report back to me

    • @VDEngineering
      @VDEngineering  7 лет назад

      Please use the link I discuss.
      You may use FlightGear 3.0, the one I use, should be fine

  • @eliezermendoza1141
    @eliezermendoza1141 7 лет назад

    Thanks, just one question. Where in Simulink Library can I find the lookup that you use?

  • @charanhm5357
    @charanhm5357 7 лет назад

    sir,
    can we use our simulink model with already existing flight model in flight gear .

    • @VDEngineering
      @VDEngineering  7 лет назад

      Copy my code in the runfg.bat file, please watch the whole video,
      where it says aircraft = hl21, change that to 'aircraft=c172p'

  • @Sarathsodisetty_6
    @Sarathsodisetty_6 5 лет назад

    sir can u make the same video another time with detail because after some trobleshoot has happen.please do for all of us those who commemted below.it will be useful for so many members

    • @VDEngineering
      @VDEngineering  5 лет назад

      I'll think about it

    • @Sarathsodisetty_6
      @Sarathsodisetty_6 5 лет назад

      Thank you sir.Can you do with in a month because i am doing autopilot design and i have to simulate sir as my final year project

  • @nozeid
    @nozeid 7 лет назад

    Hi
    thank you for sharing this, I have to questions please, if I wan't to control the aircraft by the keyboard or a joystick, is it possible with the same options you chose ?
    if I want to run this simulink file with external mode so I can link the simulator with a hardware model , is flightgear compatible with external mode?

    • @VDEngineering
      @VDEngineering  7 лет назад

      Yes, it works with third party flight simulators,
      You will have to use the 'Pilot Joystick' block in the Simulink Library Browser - Aerospace Blockset
      Regarding the keyboard, I'm not sure, it might work.
      Watch my old video on connecting joysticks to MATLAB,
      ruclips.net/video/A7KkciHn0jc/видео.html

    • @nozeid
      @nozeid 7 лет назад

      thanks a lot for responding
      I have a robot that is connected to simulink using arduino , thats require external mode on simulink, is it compatible with flight gear?
      Is joystick compatible with external mode?

    • @VDEngineering
      @VDEngineering  7 лет назад

      I'm not sure about what external mode your talking about.
      Compatible with flight gear? Yes
      The only 'external mode', is that Pilot joystick block in Simulink Browser.
      Watch my other video for a detailed explanation.

    • @nozeid
      @nozeid 7 лет назад

      whenever an arduino is connected to matlab you have to switch the simulation mode from normal to external
      so the hardware board are arduino
      if i am going to use arduino and joystick at the same time
      what board should I use?
      I mean in the configuration parameters should I choose ardino or joystick?
      and in the simulation mode, does the joystick work when the external mode is on ??

    • @VDEngineering
      @VDEngineering  7 лет назад

      I haven't used arduino ever before, so unfortunately I am not sure.

  • @payalmittal572
    @payalmittal572 6 лет назад

    Hey, Can you tell me how to add other variant subsystem in existing model when already a subsystem is working. I want to change Simulink 3D visualization to FlightGear visualization in my block diagram under visualization subsystem.

    • @VDEngineering
      @VDEngineering  6 лет назад

      That requires C++ scripting, which is beyond my knowledge, sorry!

    • @payalmittal572
      @payalmittal572 6 лет назад

      ok, thanks sir.

  • @divijsharma0102
    @divijsharma0102 4 года назад

    I am using Matlab 2019a with flightgear 2018.2.
    My Simulink crashes when flightgear opens.
    please help.

    • @VDEngineering
      @VDEngineering  4 года назад

      ruclips.net/video/b-hK5-4D5Rc/видео.html

    • @mohammadraihanhafiz2074
      @mohammadraihanhafiz2074 4 года назад

      Hi, have you the solution in matrix model in matlab 2019a? because when i try, the input value of the vector is error. please help.

  • @sorisong3735
    @sorisong3735 7 лет назад

    Your videos have been very helpful for me, but I am having some problems with setting things up. Would it be possible for you to help me? I tried setting up a flight path similar to what you did here and connected it to FlightGear. But when I ran it, the aircraft did not move. Though something that I did different, was that I used the hl20 model.

    • @VDEngineering
      @VDEngineering  7 лет назад

      Check your batch file
      Maybe you did not connect the output mux block to the FlightGear sim block.
      Are you able to run the simulation in MATLAB without FG?

    • @sorisong3735
      @sorisong3735 7 лет назад

      The mux block is connected to the sim block, I tried copying the setup you have as close as possible. The MATLAB simulation does run, but when I used scopes to see the latitude, longitude, and altitude coming out of the FE to LLA block, lat/long do not change while altitude does. But also when I ran FlightGear from it, I noticed that after I entered in dos('runfg.bat') FlightGear would start and the simulation would load in, but the Command Window never brings up the >> for the next command.

    • @sorisong3735
      @sorisong3735 7 лет назад

      Actually, I found out that the lat and long were changing, but by a very small amount. I believe the only issue is that the >> never comes back up, which makes me think there's some sort of loop, or error that's preventing it from completing.

    • @sorisong3735
      @sorisong3735 7 лет назад

      I found a way to get the simulation to run with FlightGear, but when I do, the terrain suddenly disappears, and the aircraft floats in space. Would it be possible to get the simulink architecture you used in this demonstration? I would like to look through it to make certain I am doing things right.

    • @VDEngineering
      @VDEngineering  7 лет назад

      Oh that problem is due to your latitude and longitude, they are written in opposite form, if you check or enable the HUD it should tell you.
      That happened to be before as well.
      Also check that you first installed scenery. The default FG only comes with San Francisco Bay Area.
      P.S. My architecture is the exact same as what's in the video!

  • @suryakiran3085
    @suryakiran3085 Год назад

    can you show how to connect live instead of explaining through slides ? I dont think this is understandable for beginners .

  • @kamelia9261
    @kamelia9261 Год назад

    How To Connect MATLAB and Simulink to FreeFlight ??

  • @charanhm5357
    @charanhm5357 7 лет назад

    MATLAB version is 2015a

    • @VDEngineering
      @VDEngineering  7 лет назад

      That is the one I have, You can use FlightGear V3.0