Issues running Simulink/MATLAB when running batch file for FlightGear

조회 수: 21 (최근 30일)
Richard Zhou
Richard Zhou 2018년 4월 17일
댓글: Shams ur Rehman 2022년 2월 24일
Hi all,
I have been trying to run FlightGear through a MATLAB/Simulink model with the dos command, and have been running into a key issue.
After starting FlightGear from dos('runfg.bat'), I lose access to the MATLAB and Simulink windows of work. Although FlightGear successfully starts, I am unable to run my Simulink blocks or any MATLAB scripts. As a result, I am unable to drive FlightGear with my Matlab/Simulink model.
Is there a way to run this bath file via dos while being able to compile my Simulink model?
Thank you in advance for any help!
Shown below is my batch file named 'runfg.bat'.
SET FG_ROOT=C:\Program Files\FlightGear\data C:\"Program Files"\FlightGear\bin\fgfs.exe --aircraft=ASK21 --fdm=null --enable-auto-coordination --native-fdm=socket,in,30,localhost,5502,udp --uBody=30 --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=KSFO --runway=01L --altitude=8000 --heading=0 --offset-distance=0 --offset-azimuth=0 --enable-rembrandt
  댓글 수: 2
hcr
hcr 2018년 5월 31일
I have the same issue as yours. I wonder if you have solved it?
Shams ur Rehman
Shams ur Rehman 2022년 2월 24일
hello, have you find the solution of this error? I'm facing the same issue. If, then Please tell me also how to solve it? thanks in advance.

댓글을 달려면 로그인하십시오.

답변 (2개)

auto2060
auto2060 2019년 4월 1일
dos('runfg.bat &')

Yajur Kumar
Yajur Kumar 2018년 6월 4일
I had the same issue previously. It can be solved by running the FlightGear batch file 'runfg.bat' directly from the windows explorer instead of MATLAB command window. Once your FlightGear starts and you see your airplane or cockpit view, you can run your Simulink model and it will then automatically take you to the conditions set by you in the 'runfg.bat' file and start executing your model.
  댓글 수: 2
hcr
hcr 2018년 6월 4일
Yes, it works for me using this approach.
Anbara Lutfullaeva
Anbara Lutfullaeva 2020년 2월 29일
I tried doing that but I keep getting : 'runfg.bat' is not recognized as an internal or external command,
operable program or batch file. this error.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with Aerospace Blockset에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by